csv txt cmd.exe batch file 1st column only

September 27, 2016 at 18:57:46
Specs: Windows 64
howto use a batch file using cmd.exe to export 1st column only from csv file to a txt file. ..................................................................................................................................

See More: csv txt cmd.exe batch file 1st column only

Reply ↓  Report •


#1
September 27, 2016 at 19:55:21
Im close it looks normal one column but it seems from line 8 down it is all in that one square at row 8 1st column... maybe will be ok as im just going to export to text file for a vb script to read that list of computers pulled from ad to ping for active then create two text files of those online and not then run a dns script to change all those systems as needed. I have already created the vb script and most of the accompanying batch file to do these tasks as requested just kinda stuck on this simple task to export the 1st column from a csv file to either a txt or another csv file as needed.

for /F "tokens=1 delims=," %%A in (test.csv) do (
echo.%%A
) >> output1.csv
type output1.csv


Reply ↓  Report •

#2
September 28, 2016 at 16:55:02
My test, using my own csv/text file, worked ok, but I'm win-7 32-bit. Doubtful, but you might check the format of your file is straight text. It should be, for CSV, but I don't trust anything anymore - esp. 64-bit. Aside from that, pulling a column from CSV should be a cake-walk unless your csv col 1 has one of the batch-catch: < > & |
PS: suggest you submit some sample data from the CSV. Sounds like line 8 or end of line 7 may have some issues.

message edited by nbrane


Reply ↓  Report •

Related Solutions


Ask Question