Search Results

Search: Posts Made By: pamu
2,020
Posted By pamu
$ cat file { aaa bbb aaa ...
$ cat file
{
aaa
bbb
aaa
ccc
}
ads
dvsah
{
aaa
aaa
}


$ awk '/\{/ {f=NR} f && !A[f,$0]++ {print} !f{print} /\}/{f=0}' file
{
aaa
bbb
ccc
1,415
Posted By pamu
Not clear what exact you want. Please give...
Not clear what exact you want.

Please give some more details about what you want.

$ awk '/AUS\.txt/{print "AUS.txt"}' file

AUS.txt
2,517
Posted By pamu
Then try my solution :)
Then try my solution :)
2,517
Posted By pamu
Try $ awk -F, 'BEGIN{print "record_number ,...
Try

$ awk -F, 'BEGIN{print "record_number , columns_with_diff"}
NR==FNR{for(i=2;i<=NF;i++){A[$1,i]=$i}next}{for(i=2;i<=NF;i++){if($i!=A[$1,i]){p=p?p","i:i}}print $1,p;p=""}' file1 file2...
2,201
Posted By pamu
$ awk -F "[ \|]"...
$ awk -F "[ \|]" 'NR==FNR{if($NF=="N"){A[$2]++}next}{if(!A[$NF]){print}}' file2 file1
1,403
Posted By pamu
$ egrep...
$ egrep ",[0-9]{3}-[0-9]{2}-[0-9]{2},|,[0-9]{4}-[0-9]-[0-9]{2}," file

1345721,999-03-20,400
2678103,2010-4-10,500
44,904
Posted By pamu
Yes agreed, But many times we don't have many...
Yes agreed, But many times we don't have many options.
I have only putty to access this DB and I want to validate there itself. You should understand that there are many things which are not in our...
44,904
Posted By pamu
Thanks for the quick answers. but how we can...
Thanks for the quick answers.

but how we can do it for isql ?
44,904
Posted By pamu
Get SQL query result to file in putty
How to Get SQL query result to file in putty?

I have one SQL query and I want that query output to be redirected to the file.

uname -a
SunOS XXX 5.8 Generic_117350-58 sun4u sparc...
3,278
Posted By pamu
$ sort file | awk 'BEGIN{print 0"\t"0;a=0.14}{...
$ sort file | awk 'BEGIN{print 0"\t"0;a=0.14}{ printf "%s\t%s\n", $1,a;a+=0.14}'

0 0
19.2 0.14
20.7 0.28
21 0.42
28.3 0.56
32.5 0.7
34.3 0.84
37.6 0.98
6,630
Posted By pamu
without gsub awk -F "[: ]"...
without gsub

awk -F "[: ]" 'NR==FNR{$0=toupper($0); A[$1]=$2;next} {$NF=A[$NF]}1' Mapping Config
4,122
Posted By pamu
OR $ awk -F , '!$4{$4="BIKE"}1' OFS=","...
OR

$ awk -F , '!$4{$4="BIKE"}1' OFS="," file

1,abc,55,CAR
3,bb,dd,CAR
5,ddd,tttt,BIKE
8,ee,55,BIKE
6,630
Posted By pamu
awk...
awk 'NR==FNR{$0=toupper($0);split($0,P,":");A[P[1]]=P[2];next} {gsub($NF,A[$NF])}1' Mapping Config
1,953
Posted By pamu
echo "isgc jsfh udgf osff 8462 error iwzr 653...
echo "isgc jsfh udgf osff 8462 error iwzr 653 idchisfb isfbisfb sihfjfeb isfhsi gcz eifh" | awk -F "error" '{split($2,P," ");print P[2],P[4],P[5],P[7]}'

653 isfbisfb sihfjfeb gcz
1,675
Posted By pamu
awk 'NR==FNR{B=$0;getline;A[B]=$0;next} {D=">"$0;...
awk 'NR==FNR{B=$0;getline;A[B]=$0;next} {D=">"$0; print D;print A[D]}' file2 file1

>EN_comp12952_c0_seq3:367-1668
MDKRLLNVSLLGLAFMFVFTAFQTMGNIEKTILKSIQNDYPSFTGDGYTSL
>ES_comp17168_c1_seq6:1-864...
1,953
Posted By pamu
awk 'NR==FNR{A[$3]++;next}{if(A[$3] > 1 &&...
awk 'NR==FNR{A[$3]++;next}{if(A[$3] > 1 && !B[$3]){B[$3]++;next} }1' file file

12 NIL ABD LON
12 NIL ABC AMR
13 NIL ABC AMR
11 NIL ABK AMR
1,649
Posted By pamu
$ awk '/Sheep/{F=1} /Realized/{if(F){print "a...
$ awk '/Sheep/{F=1} /Realized/{if(F){print "a goat"}else{F=""}} {print}' file
Cat
Realized
Dog
Realized
Sheep
s
d
f
jk
a goat
Realized
Wolf
a goat
Realized
Sheep
s
d
a goat
Realized
17,106
Posted By pamu
for creating new file/overriding data into...
for creating new file/overriding data into fileecho "Hello World" > hai.txt

for appending data into fileecho "Hello World" >> hai.txt
Forum: Ubuntu 01-08-2014
2,469
Posted By pamu
tryawk -F "\t" '{A[$1]=A[$1]?A[$1] ", " $NF :$1 "...
tryawk -F "\t" '{A[$1]=A[$1]?A[$1] ", " $NF :$1 " "$NF}END{for (i in A)print A[i]}' file
1,564
Posted By pamu
modified your code try key="phani;ravi;kiran"...
modified your code
try
key="phani;ravi;kiran"
number_of_keys=$(echo $key|awk '{print NF}' FS=';')
for (( i = 1; i <= $number_of_keys; i++ ));
do
key=$(echo $KEY_TO_COMPARE|awk -v var=i 'BEGIN {...
Forum: Ubuntu 01-08-2014
2,469
Posted By pamu
try $ cat file Cvel_1 KOG0155 ...
try

$ cat file
Cvel_1 KOG0155
Cvel_1 KOG0306
Cvel_1 KOG3259
Cvel_1 KOG0931
Cvel_1 KOG3638
Cvel_1 KOG0956

$ awk '{A[$1]=A[$1]?A[$1] ", " $NF :$1 "...
1,001
Posted By pamu
grep -C1 Jak file It will give above yes and...
grep -C1 Jak file

It will give above yes and below lines
1,471
Posted By pamu
Try awk -F "|"...
Try

awk -F "|" '{A[$1]=A[$1]?A[$1]"|"$NF:$1"|"$NF;next}END{for(i in A) {print A[i]}}' file
3,954
Posted By pamu
try sort -u -t "|" -k1,1 -k4,4 -k6,6 -k8,8...
try

sort -u -t "|" -k1,1 -k4,4 -k6,6 -k8,8 file
2,286
Posted By pamu
What you tried so far..? Have you checked...
What you tried so far..?

Have you checked scp and rsync ...?
Showing results 1 to 25 of 500

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