Batch script extract from .CSV-vertical,in horizontal format

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
platon39
Posts: 6
Joined: 24 Feb 2014 13:18

Batch script extract from .CSV-vertical,in horizontal format

#1 Post by platon39 » 24 Feb 2014 13:28

Hello,
i need batch script, that extracts data from a .csv file which is in format :

1233
333
4556

to horizontal format separated like : '1233','3333','4556'

Many thanks for support.

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: Batch script extract from .CSV-vertical,in horizontal fo

#2 Post by Squashman » 24 Feb 2014 15:06

Your input example does not look like a CSV file. We just did an example recently of reading in a flat text file line by line and then outputting the file as one delimited line. Could you give us a better example of what your input really looks like.

viewtopic.php?f=3&t=5380

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Batch script extract from .CSV-vertical,in horizontal fo

#3 Post by foxidrive » 24 Feb 2014 16:11

Code: Select all

@echo off
for /f "delims=" %%a in (file.csv) do set /p =%%a,<nul >>fileout.csv

Post Reply