Search Results

Search: Posts Made By: vgersh99
29,893
Posted By vgersh99
Sorry, my bad: awk -F';' ' FNR==NR { if...
Sorry, my bad:

awk -F';' '
FNR==NR { if (/This is the last line of the page/) total++;next}
/This is the last line of the page/{printf("%s\nPage No:%d of %d\n", $0, ++page, total);next}1'...
29,893
Posted By vgersh99
textfile1 textfile1 > textfile12 we're parsing...
textfile1 textfile1 > textfile12
we're parsing input file testfile1 TWICE: one for calculating the total number of pages AND second for inserting the No:N of M
For teh missing numberings for the...
29,893
Posted By vgersh99
Ah, ok. How 'bout: FNR== NR && /This is...
Ah, ok.
How 'bout:

FNR== NR && /This is the last line of the page/{ total++;next}
/This is the last line of the page/{printf("%s\nPage No:%d of %d\n", $0, ++page, total);next}1' textfile1 ...
29,893
Posted By vgersh99
# when a string "This is last..." is found, print...
# when a string "This is last..." is found, print the CURRENT page count (page) incremented by 1 (++) and the total # of pages (total)
/This is the last line of the page/{printf("Page No:%d of...
29,893
Posted By vgersh99
Hmmm... I don't quite understand the code and...
Hmmm... I don't quite understand the code and this is NOT what I meant...


awk -F';' '

FNR== NR && /This is the last line of the page/{ total++;next}
/This is the last line of the...
29,893
Posted By vgersh99
process the file twice: first for calculating the...
process the file twice: first for calculating the total, and the second to print your summary.
Showing results 1 to 6 of 6

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