PDA

View Full Version : Writing a .CSV file (.txt) from a Sheet



GGS
03-31-2011, 06:51 AM
I'm with a problem in a project, I couldn't write a code that turns my sheet into a .csv, using delimted spaces for each cell.

For instance:

On A column, there will have dates, on format YYYYMMDD.
On B, there will be a string, with 4 digits, from there, I need to get spacements fixed for variables.
The variables may have from 1 to 10 digits, the space on the .csv must be 10 digits, if there the variable has, for example, 8, it must be like this ( 12345678)

I tried to use the article " CustomDelimitedExport" but I didn't have any success with it.

I'm hoping that u can help me with it.

Thx dudes, any question, please ask.

pdx_2188
03-31-2011, 08:52 AM
Can you attach a sample excel file that you are trying to turn into a .csv file?

mdmackillop
03-31-2011, 10:30 AM
You could convert your strings to 10 characters.

=REPT(" ",10-LEN(B1))&B1