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
Post a Comment