# Write to a CSV file from postman test

**URL:** <https://community.postman.com/t/write-to-a-csv-file-from-postman-test/23004>\
**Category:** Help Hub\
**Tags:** newman-project, tests, variables, collections\
**Created:** [April 22, 2021, 8:24pm UTC](https://community.postman.com/t/write-to-a-csv-file-from-postman-test/23004 "2021-04-22T20:24:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rjayaram](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rjayaram](https://community.postman.com/u/rjayaram)\
**Post date:** [April 22, 2021, 8:24pm UTC](https://community.postman.com/t/write-to-a-csv-file-from-postman-test/23004/1 "2021-04-22T20:24:17Z")

</div>

> **Archived topic — this may be out of date.**  
> Newman has been replaced by the **[Postman CLI](https://learning.postman.com/docs/postman-cli/postman-cli-overview/)**, Postman’s official, signed command-line tool. It runs collections as Newman did, and also lints API specs, runs mocks and monitors, and syncs local files with Postman from your terminal, CI/CD pipeline or coding agent.  
> Working with an AI coding agent? The [Postman plugin](https://github.com/postmanlabs/postman-plugin) lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.  
> For current help, see the [Postman docs](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

Hi All

I have been using CSV file to read data. No issues with reading data from a csv file. I am wondering if we can write to a csv file from postman tests. I came across below documentation: [https://documenter.getpostman.com/view/3407886/RWgp1fB5](https://documenter.getpostman.com/view/3407886/RWgp1fB5)

Here is my scenario:

1. I am using postman to write API tests and newman to run the tests from Jenkins

2. Make a get call to fetch N number of XML file links (For example: The response will be like [https://xxxx1.xml](https://xxxx1.xml) to [https://xxxN](https://xxxN) .xml. and N can be more than 40) - **DONE** - This is done using postman and I am storing these XML file links in an array list (XML file links not XML file)

3. Iterate through each XML file link till Nth XML file and make a call to each XML file link.  
The response is in the XML format and these XML response has URL links inside - (I am parsing the response of these XML links and I am  
able to get the URLs. There are more than 100(say X) URLs in each XML file link - I am storing this in a list and saving this in an env variable so that I can access the list (say LIST\_A) env variable in the next test. **DONE**

4. I need to go through each XML file link (N files) dynamically , parse the response to extract the URLs and validate every URL (X number of URLs in each XML file link) to make sure it returns 200. I am using another list(LIST\_B) to store all the URLs- **DONE**

5. Instead of storing all the URLs from each XML file link into a list(LIST\_B), I would like to store the parsed URL links in a CSV file

6. I would like to read the URLs from the CSV file and validate the URLs using a GET call

7. Pl suggest me an efficient solution as I do not want to over load the env variable(List) as I may hit size limitation due to number of elements in the list.

_I’ve already tried_: Tried storing the list into an env variable .  
Notes: I came across the below article using Node JS and newman. I am not sure if this solution can be used to write just the URLs for my scenario above. [How to save String from json response to excel or csv file?](https://community.postman.com/t/how-to-save-string-from-json-response-to-excel-or-csv-file/15265)

Thanks, Raje
