Splitting up Large CSV FileWrites

 

I am trying to build a CSV file where the columns exceed the max number parameters that can be taken into FileWrite (which according to the documentation is 63). 

Is there a way to to split up the FileWrite so that I can write to more than 63 columns? The data types of my parameters include datetimes, int, and doubles. 

I was thinking of putting consecutive FileWrites in a row, but according to the documentation on FileWrite, "/r/n" gets added automatically to the end of each line. 


Thanks in Advanced

 
Use StringFormat to convert your variables to strings with your separator in between. Write the string.
 
William Roeder:
Use StringFormat to convert your variables to strings with your separator in between. Write the string.

Would I need to do some variable conversion in excel? Or will excel still be able to recognize the data type?

 
CSV is a text file. There are no data types in a text file.
 
William Roeder:
CSV is a text file. There are no data types in a text file.

Oh my apologies, that was a brain fart, thanks

 
William Roeder:
Use StringFormat to convert your variables to strings with your separator in between. Write the string.
Another quick question, is there an easy way to add a delimiter this way or do I just do it the brute force way (StringFormat("%f; %f; .... ;  \r\n"), arg1, arg2, ...). Is there some sort of custom regex shortcut? 
 
  1. That is the easy way.
  2. Drop the spaces; you don't write spaces with the FileWrite.
  3. Drop the last separator. It's a separator, not a terminator. "%f;%f"
  4. Drop the "\r\n"; part of the FileWrite.
 
William Roeder:
  1. That is the easy way.
  2. Drop the spaces; you don't write spaces with the FileWrite.
  3. Drop the last separator. It's a separator, not a terminator. "%f;%f"
  4. Drop the "\r\n"; part of the FileWrite.

works, thanks. This saves me a lot of time

Reason: