bash - Copy File ignoring Column(s) -


i have .txt this:

dummy1, dummy2, dummy3, dummy4,  dummy1, dummy2, dummy3, dummy4, dummy1, dummy2, dummy3, dummy4, dummy1, dummy2, dummy3, dummy4, dummy1, dummy2, dummy3, dummy4, 

i want save information in file, ignoring (for example) column 2 and/or 4. how can it?

if have access awk command then:

awk '{ $2=""; $4=""; print}' test.txt > new.txt 

where $2 second column , $4 fourth. contents of new.txt file be:

dummy1, dummy3, dummy1, dummy3, dummy1, dummy3, dummy1, dummy3, dummy1, dummy3, 

just change columns in print different configurations. i.e.

awk '{ $2=""; print}' test.txt > new.txt 

the contents of new.txt file be:

dummy1, dummy3, dummy4, dummy1, dummy3, dummy4, dummy1, dummy3, dummy4, dummy1, dummy3, dummy4, dummy1, dummy3, dummy4, 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

c# SetCompatibleTextRenderingDefault must be called before the first -