You forgot the very last argument : the filename on which you run you awk command !!!
You can enhance the code so it pick up the name of the file that is currently being processed by awk :
Example:
---------- Post updated at 09:21 PM ---------- Previous update was at 09:07 PM ----------
but my code may behave erroneously : if no value exists in $2 it will report the line number, so maybe you would prefer ygemici code which also have the advantage not to scan further line as soon as the first "2cnd-column-equal-zero" line has been found
I need to find to find duplicate lines in a document and then print the line numbers of the duplicates
The files contain multiple lines with about 100 numbers on each line I need something that will output the line numbers where duplicates were found ie 1=5=7, 2=34=76
Any suggestions would be... (5 Replies)
How to insert leading zeros into a left-justisfied zip code?
e.g. Zip code is written as 60320 which is left-justified to make it be read as 0060320.
We have to move it to right-justifiable then insert 2 leading zeros into it... ;) (1 Reply)
Hi
A question about numeric display there...
Is there any option in awk that would prints a number with "left filled with zero" format, and how does it work with variable length definition?
For instance IŽd like my variable to be left filled with 0s for a length of 3 in total:
4 would be... (3 Replies)
Hi,
I want to trim +with leading zero's with amount fields.I know using awk for trimming leading zeros with +,but I want get the entire row itself.
cat file_name |awk -F " " '{printf "%14.4f%f\n",$4}'
ex:
10 xyz bc +00000234.4500
20 yzx foxic +002456.000
Expexted
10 xyz bc... (3 Replies)
Hi Friends,
I would like to left pad with "0's" on first column say (width six)
I have a large file with the format:
FILE:
1: ALFRED 84378 NY
8385: JAMES 88385 FL
323: SMITH 00850 TX
My output needs to be like:
000001: ALFRED 84378 NY
008385: JAMES 88385 FL
000323: SMITH... (10 Replies)
Hi,
I have a input string 0000106 I need to extract the number after leading zeros ie the number 106. I used the command tr -d "0" and got the output as 16. Could any one of you please help me in using the tr command to get the output 106. Thanks in advance.... (2 Replies)
I am compiling a synonym dictionary which has the following structure
Headword=Synonym1,Synonym2 and so on, with each synonym separated by a comma.
As is usual in such cases manual preparation of synonyms results in repeating the synonym which results in dupes as in the example below:... (3 Replies)
I am revisiting the problem of sentence splitting. I have a Perl Script which splits a para into sentences, but acronyms and short forms create an issue
#!/usr/bin/perl
use feature qw/say/;
use strict;
use warnings;
my $s;
my @arr;
while(<>) {
chomp $_;
$s .= $_ . " ";
}
@arr... (2 Replies)