I have several big csv file that have 48 columns. From these, I only need 5 of them -- columns 6,7,14,18,31.
Is there a way I can automate this and putting it in a new file? Hope it could be via a dos script or something.
Thanks!
jecmac, I'd think it's gonna be somewhat tedious to set up since there are so many values involved, but seems to me that you need simply to designate the # item in the CSV file you desire and your machine can fetch it (at machine speed, FAST!). Perhaps designate a specific item by # and then fetch a range of values?
HTH.
Ed in Texas.
DOS can do it, if the file is a bit "readable" ... meaning that it is a textfile, not a binary file (eg. Excel, Word, ...) BUT ... you should post this (or a similar) thread in the "programming" forum, they'll be happy to help you
Use the following command awk -F"," '{print $6,$7,$14,$18,$31.}' your_file.csv
Try this: @echo off cls setlocal for /f "tokens=1-31 delims=," %%A in (your_input_file.csv) do ( echo %%F,%%G,%%N,%%R,%%_>>your_output_file.csv )
@Wahine Thanks a lot!! Worked great!!
You're welcome, thanks for coming back to advise about your successful outcome.