Append to CSV file

You can not use external files directly in postman other than for data file. But a work around is to use the visualizer function. Add the below code in your test section

 //Assuming you have your csv content in the variable csv
 csv=JSON.stringify(csv)


a =`
<html>
    <body>

        <input type="file" id="fileinput" />
        <pre id="ReadResult"></pre>
        <script type="text/javascript">
            function readSingleFile(evt) {
                //Retrieve the first (and only!) File from the FileList object
                var f = evt.target.files[0];
                if (f) {
           
                    var r = new FileReader();
                    r.onload = function (e) {
                        var contents = e.target.result;
                        contents = contents + "\\n" + ${csv}
                        console.log(contents)
                        const blob = new Blob([contents], { type: 'text/plain' });
const a = document.createElement('a');
a.setAttribute('download', "fileName.csv");
a.setAttribute('href', window.URL.createObjectURL(blob));
a.click()
                       document.getElementsByTagName("body")[0].appendChild(a);
                    }
                    r.readAsText(f);
                } else {
                    alert("Failed to load file");
                }
            }

            document.getElementById('fileinput').addEventListener('change', readSingleFile, false);

        </script>
    </body>

</html>`


pm.visualizer.set(a)

Now goto visualize tab:

enter image description here

Just upload the csv file you have , this will append the content to that file and ask where to save the file.