Importing a csv file without column headers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2015 11:00 AM
Is this possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2016 04:53 AM
We have to communicate with some "ugly" system which is providing data without header.
As I mentioned I would like to save the data from every row into single column and then parse the column based on some rules.
Very dirty approach, but seems as the only way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2017 10:06 AM
workaround I've used > get the data into Excel (or equivalent spreadsheet), then add header, save, etc..
But I am exploring using a script to do this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-25-2018 05:36 PM
I just had the same need. My data source comes from a csv hosted on a web server so I use the HTTPS method. What I did was created a custom processor on my instance ie https://blah.service-now.com/mycsv. In the processor I use REST api to get my original csv and then I add a header row to it and serve it back to the requestor (data source).
This is my processor script:
(function process(g_request, g_response, g_processor) {
var sm = new sn_ws.RESTMessageV2();
sm.setEndpoint("http://originalsourceofcsv.com.au/thecsv");
sm.setHttpMethod("get");
sm.setHttpTimeout(6000); //optional
sm.setLogLevel("all"); //optional
sm.setMIDServer("Mid1"); //optional
var response = sm.execute();
//Write output
var headerrow = "Column1,Column2,Column3,Column4\n";
g_processor.writeOutput("text/plain",headerrow + response.getBody());
})(g_request, g_response, g_processor);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2019 08:57 AM
Hadyn,
I think this will work for an issue I am currently having where I have a duplicate column in a CSV file I get daily from an FTP server. However, I'm not sure what you mean by "serve it back to the requestor (data source)." How would I get the newly edited file into data source?
Thanks!