1.

Solve : Column Cut?

Answer»

Hi,

I have a file with 7 columns seperated with comma. I want to SELECT only the fourth column from the file. Can ANYONE please tell me how to do the same.

E.g File XXX with columns A,B,C,D,E,F,G

I want to select only column D data.

Thanks in advance

Regards
P.CWe created a csv file the other day. Seems only fair we PICK it apart today.

Code: [Select]@echo off
for /f "tokens=1-7 delims=," %%a in (file.xxx) do (
echo %%d
)

%%d is column D data.

The code was designed to keep it simple: colA is %%a, colB is %%b, colC is %%c, etc




you can download GNU awk for windows here.
then on the command line
Code: [Select]C:\test>gawk -F, "{print $1,$2,$3,$4}" file.txt
A B C D



Discussion

No Comment Found