Using awk I want to get columns starting with /acq/old/*.
file1
z y x / ACQ / old / a.zip y
z y t / ACQ / old / a.zip x
The fourth column
file2
z y / ACQ / old / a.zip 10
z y / ACQ / old / a.zip 20
the third column
…
file n
z y w t / ACQ / old / x.zip 100
z y f r / ACQ / old / w.zip 200
The fifth column
I want to do following an operation.
for myfile in ls *. txt
do
awk '??' $ myfile
other processes
done
You can use
sedto get rid of leading columns:This is
awksolution: