Search Results

Search: Posts Made By: Saanvi1
1,604
Posted By RudiC
Slightly different approach: awk ' ...
Slightly different approach:
awk '
{gsub (/ */, " ")
IX = $1
sub ("^" $1, _)
}

NR == FNR {TMP[IX] = $0
...
1,604
Posted By Don Cragun
Since you're using a Solaris/SunOS system, you'll...
Since you're using a Solaris/SunOS system, you'll need to use /usr/xpg4/bin/awk or nawk instead of awk. I don't see the need for the three arrays that rdrtx1 used... I think the following should...
1,604
Posted By rdrtx1
awk ' NR==FNR {$1=$1; a[$1]=$0; next} a[$1]...
awk '
NR==FNR {$1=$1; a[$1]=$0; next}
a[$1] {l=$0; $1=$1; if (a[$1] != $0) print l}
' File1 File2
5,003
Posted By Scrutinizer
Try: sed '1d;$d' Test1.txt | sort -t\| -k2,3 >...
Try:
sed '1d;$d' Test1.txt | sort -t\| -k2,3 > Test2.txt
5,003
Posted By MadeInGermany
With sed instead of GNU head { read header;...
With sed instead of GNU head
{
read header; printf "%s\n" "$header"
sed '$d' | sort -t\| -k2,3
} < Test1.txt > Test2.txt
4,070
Posted By Don Cragun
Try changing: sub...
Try changing:
sub (/(__[0-9])*\./, "__" ++CNT ".", OF)to:
sub (/(__[0-9]+)*\./, "__" ++CNT ".", OF)
4,070
Posted By RudiC
Without sorting, try awk ' NR==1 ...
Without sorting, try awk '
NR==1 {HD=$0
OF=FILENAME
next
}
!((NR-2)%lines) {if (OF) close (OF)
sub (/(__[0-9])*\./,...
3,178
Posted By in2nix4life
Maybe something like this: zip...
Maybe something like this:


zip APP_Deg_Dummy_$(ls | head -n1 | awk -F_ '{print substr($2, 1, 8)"TM"substr($2, 10, 6)}').zip Dummytest_20140601W110515_file*
adding:...
1,553
Posted By Yoda
The program reads first file and stores the value...
The program reads first file and stores the value of first field as key in Associate Array: A

The program then reads second file and check if first field is not a key in Associate Array: A and...
2,349
Posted By Don Cragun
This can be done thousands of ways on any UNIX...
This can be done thousands of ways on any UNIX System. Finding something simpler than a two line awk program may be difficult. If you're unwilling to use /usr/xpg4/bin/awk, what tools are you...
Showing results 1 to 10 of 10

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