Book a Demo

Author Topic: Read CSV row, then update same CSV row  (Read 4139 times)

ggandhi

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Read CSV row, then update same CSV row
« on: March 21, 2014, 10:56:03 pm »
The following JScript code enables me to read a CSV file and build a Sparx Node per row. Please can you show me how to write back to the same CSV row, updating a spare column?
 
var fsObject = new ActiveXObject( "Scripting.FileSystemObject" );
var file = fsObject.GetFile( fileName );
var inputStream = file.OpenAsTextStream( FSREAD, 0 );
// Read the file a row at a time
while ( !inputStream.AtEndOfStream )
{
// Get the current line and split it into segments based on the CSV_DELIMITER
var currentLine = inputStream.ReadLine();
var currentLineTokens = currentLine.split( CSV_DELIMITER );

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Read CSV row, then update same CSV row
« Reply #1 on: March 22, 2014, 02:20:41 am »
You are better served to ask such a question at StackOverflow (after searching there) since this is not EA related.

q.