Search Results

Search: Posts Made By: anbu23
3,027
Posted By anbu23
ls | awk -F"status_|[.]log" ' { print $2 }...
ls | awk -F"status_|[.]log" ' { print $2 } '
3,666
Posted By anbu23
$ awk ' /FileName_ID/ || /^$/ { print; next} {...
$ awk ' /FileName_ID/ || /^$/ { print; next} { a=$0; getline; print $NF, a } ' file
xxxx_0002 00-0000-Lname-Fname-REPEAT
xxxx_0008 111111-yyyy
xxxx_0006 111111-yyyy-0
FileName_ID

FileName_ID
1,126
Posted By anbu23
$ sed -e 's/[^\t]*id/& \ /g' -e...
$ sed -e 's/[^\t]*id/& \ /g' -e 's/[^\t]*alias_./& \ /g' file
Chr1 lnci exon 83801516 83803251 . - . gene_id "LINC01725"; transcript_id "LINC01725:44"; ...
5,292
Posted By anbu23
$ echo '/fin/app/scripts\\n/fin/app/01/sql' | sed...
$ echo '/fin/app/scripts\\n/fin/app/01/sql' | sed -e 's#\\\\n# #g';
/fin/app/scripts /fin/app/01/sql
$ echo '/fin/app/scripts\\n/fin/app/01/sql' > file
$ sed -e 's#\\\\n# #g' file...
2,591
Posted By anbu23
$ awk -v Tyre='Four' ' $0 ~ /Vehicle:/ { veh=$0 }...
$ awk -v Tyre='Four' ' $0 ~ /Vehicle:/ { veh=$0 } $0 ~ "Tyre : "Tyre { print veh } ' file
> Vehicle: BMW Class
Vehicle: Toyota Class
2,722
Posted By anbu23
$ awk ' FNR == NR { ky=$4; sub("_.*","",ky);...
$ awk ' FNR == NR { ky=$4; sub("_.*","",ky); arr[ky]=$0; next } {print arr[$1]} ' content.xls id.txt
NC_020815.1 1891831 1894692 virb4_A0A0H2X8Z4_ 1 954 1945
NC_020815.1 ...
4,437
Posted By anbu23
$ awk '{ currKey = $2 } > currKey != prevKey {...
$ awk '{ currKey = $2 }
> currKey != prevKey { prt(); min=$3; cnt=0 }
> { prevRec=$0; prevKey=currKey; max=$3; cnt++ }
> END { prt() }
>
> function prt( f) {
> if ( cnt ) {
> ...
3,933
Posted By anbu23
$ awk -v RS="\nName:" -v OFS="," -v FS="\n" -v...
$ awk -v RS="\nName:" -v OFS="," -v FS="\n" -v ORS="\nName:" ' { print $1 OFS $2 ($3 ? OFS $3 : "") } ' file
Name: serve1,has disk :Yes,dev (8):
Name: serve2,has disk :No,dev (8):
Name: serve3,has...
3,547
Posted By anbu23
If you want to print block which contains pattern...
If you want to print block which contains pattern devId="number"

awk -v RS="</alarms>" -v ORS="</alarms>" ' devId="number" ' logfile
2,899
Posted By anbu23
$ echo '[string 1 ] apple [ string 2]' | perl -pi...
$ echo '[string 1 ] apple [ string 2]' | perl -pi -e ' s/[[][^]]*]//g; '
apple
2,739
Posted By anbu23
$ awk -F'\\]|\\[|-|:' -v RS='\n>' ' NR == FNR {...
$ awk -F'\\]|\\[|-|:' -v RS='\n>' ' NR == FNR { gsub(" ",""); arr[$3]=1;next} arr[$2]{print ">" $0} ' f1 f2
>Contig_152:50833-51615
CGGAGTAGCTTCGATCAGCGTGACCGGTACCGAGCGACCGTCTTCAGTGAAGACGCGGCT...
2,980
Posted By anbu23
$ awk -F: -v list="01,02,03" ' NR==1 {...
$ awk -F: -v list="01,02,03" ' NR==1 { split(list,arr,",") } { sub("tcname",arr[NR]) } 1 ' OFS=: File1
01:fail
02: Pass
03:skipped
981
Posted By anbu23
file_path=${output_dir} files_list=`ls...
file_path=${output_dir}
files_list=`ls ${output_dir}/*MIGRATE*${city_name}*.out`
1,798
Posted By anbu23
$ awk ' { for(i=1;i<=NF;i++) print i, $i } ' file...
$ awk ' { for(i=1;i<=NF;i++) print i, $i } ' file | sort | awk ' { print $2 } '
1
A
X
2
B
Y
3
C
Q
4
E
M
5
1,507
Posted By anbu23
If you want to print second occurrence try like...
If you want to print second occurrence try like this
$ awk -F"Xms" ' { sub(" .*","",$3); print $3 } ' file.txt
8192m
2,011
Posted By anbu23
sed "s/[1-9][0-9]\{2,\}/TRUE/g" file
sed "s/[1-9][0-9]\{2,\}/TRUE/g" file
3,507
Posted By anbu23
$ awk -F, -v OFS=, ' { sub("^.$","&&",$1) } 1 '...
$ awk -F, -v OFS=, ' { sub("^.$","&&",$1) } 1 ' file
CC,rs18768
GG,rs13785
GA,rs1065
GG,rs1801279
TT,rs9274407
AA,rs730012
1,461
Posted By anbu23
$ cat /dev/urandom | tr -dc 'A-Z' | fold -w 8 |...
$ cat /dev/urandom | tr -dc 'A-Z' | fold -w 8 | awk ' { if(NR < 11) { printf("%02d\n%s\n\n",NR,$0) } else { exit} } '
01
STUVMDHN

02
IHLVHDGD

03
RDZMKZVS

04
MLPNBHCD

05
QWCPAZRD
...
1,755
Posted By anbu23
awk '/^GIR/ {GN = $0}; /^LIN/ {LN = $0} /^QTY/...
awk '/^GIR/ {GN = $0}; /^LIN/ {LN = $0} /^QTY/ {print GN, LN, $0, FILENAME}' DVA* >>$tarih_report1.txt
863
Posted By anbu23
for file in /Dir/Dir1/*.csv do awk ' $0 ~...
for file in /Dir/Dir1/*.csv
do
awk ' $0 ~ keyword1"|"keyword2"|"keyword3 && k++<3; k==3{exit} ' keyword1="avrbs2" keyword2="avrbs2" keyword3="xop" $file
done
2,732
Posted By anbu23
sed -i 's#-#/#g' file
sed -i 's#-#/#g' file
2,224
Posted By anbu23
$ awk -F"|" -v OFS="|" ' $NF { $NF=","$NF;...
$ awk -F"|" -v OFS="|" ' $NF { $NF=","$NF; gsub(",",","$(NF-1),$NF); sub(",","",$NF) } 1 ' file
USS|AWCC|AFGAW|93|9370
USSAA|Roshan TDCA|AFGTD|93|9372,9379
ALB|Vodafone|ALBVF|355|35569...
2,233
Posted By anbu23
$ awk -F'[- ]' ' !a[$3]++ { print $3 } ' file ...
$ awk -F'[- ]' ' !a[$3]++ { print $3 } ' file
EPAS1
CPS1
NOTCH3
1,141
Posted By anbu23
$ sed "/.\{14\}1/s/./0/15" file ...
$ sed "/.\{14\}1/s/./0/15" file
#-----------------------------------
3 ! number of parameters of the polynome
0.00000e+00 0 ! fix=0) free=1
1.03916e-03 0 ! fix=0) free=1...
1,339
Posted By anbu23
awk -F"\t" ' { print $(NF-1) > "File-1.txt";...
awk -F"\t" ' { print $(NF-1) > "File-1.txt"; print $NF > "File-2.txt" } ' Inputfile
Showing results 1 to 25 of 167

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