Search Results

Search: Posts Made By: script_op2a
9,111
Posted By DGPickett
Use GNU Awk? "sort ... | uniq -d | wc -l | read...
Use GNU Awk? "sort ... | uniq -d | wc -l | read dup_ct"
Forum: HP-UX 05-24-2011
2,809
Posted By fpmurphy
Beginning Sept 2010, HP-UX patch access is...
Beginning Sept 2010, HP-UX patch access is through the IT Resource Center (http://www11.itrc.hp.com/service/home/home.do) (ITRC) support portal. You need a valid ITRC account and an active HP support...
6,178
Posted By birei
Hi, No idea. Can't help much more. But...
Hi,

No idea. Can't help much more.

But I would try to process the file in two executions, the first half and the second half. Or try with other language, like 'Perl'.

Regards,
Birei.
2,038
Posted By Corona688
You don't need to use awk to get a result from wc...
You don't need to use awk to get a result from wc -l, that's severe overkill.

LINES=$(wc -l < inputfile)

You're also comparing as strings, not integers. Try mathematical comparison:

if [...
9,310
Posted By rdcwayx
a simple solution, base on previous script. ...
a simple solution, base on previous script.

awk '{split($4,a,"_"); if (b[$1]<=a[4]a[5]) {b[$1]=a[4]a[5];c[$1]=$0}}
END{for (i in b) print c[i]}' infile |sort > desired_records

sort infile >...
3,768
Posted By Scott
This is not the same code you posted in your...
This is not the same code you posted in your other thread.

Yet, pertains to the same problem:


awk '{print $0 > "newfile.txt"}' $infile
9,310
Posted By rdcwayx
awk '{split($4,a,"_"); if (b[$1]<=a[4]a[5])...
awk '{split($4,a,"_"); if (b[$1]<=a[4]a[5]) {b[$1]=a[4]a[5];c[$1]=$0}}
END{for (i in b) print c[i]}' infile
5,131
Posted By vgersh99
./rem_dups.sh 1 /home/usr/script dups_file.txt
./rem_dups.sh 1 /home/usr/script dups_file.txt
5,131
Posted By agama
Assuming you have a modern awk (nawk on Sun) this...
Assuming you have a modern awk (nawk on Sun) this should work. I've added some 'fluff' to illustrate how to capture the command line parameters and use them in your script (don't mean to imply that...
Showing results 1 to 9 of 9

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