Search Results

Search: Posts Made By: Chulamakuri
2,045
Posted By pravin27
try this, awk '{for(i=1;i<=NF;i++) {if(NR==1 &&...
try this,
awk '{for(i=1;i<=NF;i++) {if(NR==1 && $i~/ddd/) {print $i;a=i;next}if(a>0){print $a;next}}}' filename
2,045
Posted By CarloM
I imagine there are much neater ways, but this...
I imagine there are much neater ways, but this seems to work:
awk -vMYCOL="ddd" '{if (NR == 1) { for (i=1;i<=NF;i++) { if ($i == MYCOL) { mycolnum = i } } } { print $mycolnum }}' file1

EDIT:...
11,885
Posted By GERMANICO
another solution
without the command "gzip" but with the command "gzcat"...
it is faster...:b:

for files in *.gz
do
FILE=`echo ${files} | cut -d"." -f1`
gzcat ${files}| tail +2 > ${FILE}
mv ${files}...
11,885
Posted By citaylor
Most important thing is to backup these files...
Most important thing is to backup these files before you try doing "mass" updates like these.
Then try something like:

for files in *.gz
do
gzip -dc "$files" | tail +2 | gzip -c >...
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 09:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy