want to save only the last iteration vaues in a file, what will the code can anyone help?
You can get the current iteration number using the NeoLoad Javascript API.
For example like this: context.currentVU.getCurrentIteration();
You can't know the last iteration unless your test is run by iteration in that case you can know in advance what the last iteration number will be.