Search Results

Search: Posts Made By: Bastami
1,827
Posted By RudiC
This one wouldn't need the file supplied on the...
This one wouldn't need the file supplied on the command line but would try to find the files named in task1 or task2:awk '
FNR == 1 {FC++
FN = FILENAME
if...
1,827
Posted By RudiC
first approximation:awk ' FNR == 1 {FC++...
first approximation:awk '
FNR == 1 {FC++
FN = FILENAME
if (FC < 3) {OUT[FC] = FN ".new"
print > OUT[FC]
...
1,827
Posted By RudiC
Any ideas/thoughts/attempts from your side? ...
Any ideas/thoughts/attempts from your side?

---------- Post updated at 13:12 ---------- Previous update was at 13:10 ----------

Is there always just one single line for one single file in task1...
8,489
Posted By MadeInGermany
while read f1 f2 f3 do awk...
while read f1 f2 f3
do
awk 'NR==start,NR==end {sum+=$2} END {print FILENAME,start,end,sum}' start="$f2" end="$f3" "$f1"
done < B > B.new
If B.new looks okay, you can rename it to B
mv B.new B
8,489
Posted By RudiC
For above sample, this should doawk ' ...
For above sample, this should doawk ' {printf "%s ", $0
FN=$1; ST=$2; EN=$3;
while ($1+0 < EN) {getline < FN
...
Showing results 1 to 5 of 5

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