Search Results

Search: Posts Made By: nua7
1,990
Posted By RavinderSingh13
Hello nua7, Sorry for same, I forgot to...
Hello nua7,

Sorry for same, I forgot to mention it will only look for string EXIT as per your input shown in POST#1, following may give you expected output, let me know if you have any queries on...
1,990
Posted By RavinderSingh13
Hello nua7, Could you please try following...
Hello nua7,

Could you please try following and let me know if this helps.

awk '($0 == "EXIT"){A=$0;getline;if($0 == "JCWPROD"){print A ORS $0} else if($0 != "JCWPROD" && $0 != "EXIT") {print...
1,119
Posted By Subbeh
Try this: awk -F\| 'NR==FNR {a[$1]=$0; next} $1...
Try this:
awk -F\| 'NR==FNR {a[$1]=$0; next} $1 in a {print a[$1]; next}1' file1 file2
963
Posted By Scrutinizer
Try (reading file twice, original order) awk...
Try (reading file twice, original order)
awk -F\| 'NR==FNR{if(($3,-$5) in A) delete A[$3,-$5]; else A[$3,$5]; next} ($3,$5) in A' file file
The input file is specified twice..
795
Posted By Yoda
awk -F\| '++A[$1]<=2' file
awk -F\| '++A[$1]<=2' file
1,875
Posted By Yoda
awk -F\| ' FNR == NR { ...
awk -F\| '
FNR == NR {
a[$1] = $2"^"$8"^"$4
next
}
a[$2] {
split(a[$2],b,"^")
$8 = b[1]
...
1,227
Posted By pamu
awk -F \| '$2 !~ /SUPP1/ && $2 ~...
awk -F \| '$2 !~ /SUPP1/ && $2 ~ /[0-9]/{$(NF-1)=$(NF-2)=0}1' OFS="|" file
1,461
Posted By Yoda
awk -F\| 'NR==FNR{A[$1]=$0;next}$1 in A{print...
awk -F\| 'NR==FNR{A[$1]=$0;next}$1 in A{print A[$1],$3}' OFS=\| ${SHTEMP}NPBR5.XTR.tmp ${SHTEMP}NPBR1.XTR.final
1,461
Posted By Yoda
awk -F\| 'NR==FNR{A[$1]=$0;next}$1 in A{print...
awk -F\| 'NR==FNR{A[$1]=$0;next}$1 in A{print A[$1]}' ${SHTEMP}NPBR5.XTR.tmp ${SHTEMP}NPBR1.XTR.final
888
Posted By Yoda
awk -F\| 'NR==FNR{A[$1]=$0;next}$1 in...
awk -F\| 'NR==FNR{A[$1]=$0;next}$1 in A{$0=A[$1]}1' tst6 tst1
934
Posted By rveri
Hi nua7 , >Is there a way in awk that the field...
Hi nua7 ,
>Is there a way in awk that the field can be converted to a 10 digit field so that total amount =0000000700
- check this out:

echo "700" | awk '{printf "%010d\n",$0}'
0000000700
2,086
Posted By Revansidhu
Try this one awk '{print $1 " "$2 " "...
Try this one

awk '{print $1 " "$2 " " $3-($1+$2)}' file
0012.00 0010.00 1554.53
0100.00 0500.00 352.83
0500.00 0500.00 760.74
0000.00 0000.00 1536.04
0000.00 0000.00 389.08
0000.00 0000.00...
1,147
Posted By joeyg
Just thinking...
Gotta re-load unix on this PC, so this is all theory...

cut -d"|" -f1 <file1 >file1key
grep -f file1key <file2
1,147
Posted By Yoda
join -t"|" -1 1 -2 1 -o 1.1 1.2 1.3 1.4 1.5 1.6...
join -t"|" -1 1 -2 1 -o 1.1 1.2 1.3 1.4 1.5 1.6 1.7 file2 file1
1,166
Posted By Scrutinizer
I am not sure if I understand what you are...
I am not sure if I understand what you are looking for, something like this?
awk -F\| 'NR==FNR{A[$1]=$0; next} {for(i=12; i<=20; i++) if($i in A)print A[$i]}' mppartc.desc inst_full_denied
If not...
1,826
Posted By vgersh99
awk -v qq='"' '{$8= (qq...
awk -v qq='"' '{$8= (qq ($8~("^"qq"SS")?"MEMBER":"PROVIDER"))}1' FS='|' OFS='|' myFile
903
Posted By shamrock
awk -F\| '{ if ($(NF-2) == "\"P\"") ...
awk -F\| '{
if ($(NF-2) == "\"P\"") p[$2] = (p[$2] ? p[$2] RS $0 : $0)
else if ($(NF-2) == "\"D\"") d[$2] = (d[$2] ? d[$2] RS $0 : $0)
} END {
for (i in p) {
if (i in d)...
903
Posted By rdrtx1
try: sort -t"|" -k 2,22 input_file | awk -F"|"...
try:
sort -t"|" -k 2,22 input_file | awk -F"|" '
$(NF-2) ~ /"P"/ {p[$2]=$0; print $0 > "Paid.txt"}
$(NF-2) ~ /"D"/ {d[$2]=$0; print $0 > "Denied.txt"}
p[$2] && d[$2] {print p[$2]"\n"d[$2] >...
1,868
Posted By Corona688
On third look, I see a bug in that: -F, ...
On third look, I see a bug in that:

-F,

That tells it to use , as the separator.

Your file needs -F'|' instead.
1,695
Posted By rdrtx1
try: awk -F"|" '{if...
try:
awk -F"|" '{if ($15>b[$7]){a[$7]=$0;b[$7]=$15}}END{for (i in a) print a;}' [I]inputfile
3,096
Posted By radoulov
[ ! -f /lv8/diamond/shprod/data/hcfadata.dat -o !...
[ ! -f /lv8/diamond/shprod/data/hcfadata.dat -o ! -f /lv8/diamond/shprod/data/PDPhcfadata.dat ]

or:

[ ! -f /lv8/diamond/shprod/data/hcfadata.dat ] || [ ! -f...
955
Posted By rdrtx1
if (( index(riderStr,"R") || index(riderStr,"A")...
if (( index(riderStr,"R") || index(riderStr,"A") || index(riderStr,"C")) && COUNTY != "WORCE" )
2,130
Posted By zaxxon
I assume I understood now (lol). BDUSERNAME is...
I assume I understood now (lol). BDUSERNAME is now empty, notice the ",,".

$ awk -F, 'NR==FNR{_[$1]=$2; next} _[$1] {print; next} {$2=""; print}' OFS=, f1 f2
aa2154,,COLOR,0
aa2154,,LTPRT,2...
1,295
Posted By bartus11
Try this then:sort file | awk...
Try this then:sort file | awk 'BEGIN{FS="|"}!a[$1]++'
1,049
Posted By itkamaraj
use !~ awk -F\| '$20~/./'...
use


!~



awk -F\| '$20~/./' shme069.xtr6 > tst1

awk -F\| '$20!~/./' shme069.xtr6 > tst2
Showing results 1 to 25 of 26

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