Search Results

Search: Posts Made By: Liverpaul09
8,958
Posted By Scrutinizer
You could use tail like this: for i in *.txt ...
You could use tail like this:
for i in *.txt
do
tail -1 "$i"
done

Your script can be adjusted like this
BEGIN {
print "Starting script...";
}
last_file != FILENAME && NR!=FNR {
...
9,390
Posted By malcomex999
awk 'FNR==2{print $0 > "new"FILENAME}'...
awk 'FNR==2{print $0 > "new"FILENAME}' file[123].txt
10,283
Posted By bartus11
awk 'FNR==1 && NR==1{printf FILENAME" "}FNR==1 &&...
awk 'FNR==1 && NR==1{printf FILENAME" "}FNR==1 && NR!=1{printf "\n"FILENAME" "}$1~"UWI" || $1~"LSR"{for (i=3;i<=NF;i++)printf $i" "}END{printf "\n"}' *.txt
10,283
Posted By bartus11
Try:awk 'FNR==1 && NR==1{printf FILENAME"...
Try:awk 'FNR==1 && NR==1{printf FILENAME" "}FNR==1 && NR!=1{printf "\n"FILENAME" "}$1~"UWI" || $1~"LSR"{printf $3" "}END{printf "\n"}' *.txt
Showing results 1 to 4 of 4

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