Search Results

Search: Posts Made By: anbu23
2,809
Posted By anbu23
$ sort -t"," -k1,1 -u file ...
$ sort -t"," -k1,1 -u file
ENSG00000003137,ENST00000001146
ENSG00000003402,ENST00000309955
3,851
Posted By anbu23
ls | awk -F"status_|[.]log" ' { print $2 }...
ls | awk -F"status_|[.]log" ' { print $2 } '
2,869
Posted By anbu23
Can you post expected output?
Can you post expected output?
1,674
Posted By anbu23
Can you post what you tried?
Can you post what you tried?
3,920
Posted By anbu23
$ cat check.sh fileprops="-rwxrwxrwx user1...
$ cat check.sh
fileprops="-rwxrwxrwx user1 2019-08-31 17:36 /fin/app/01/scripts/filename6.src 4294967295"
echo "FILE PROPERTY: $fileprops"
echo "PARAMETER3: $1"

if [[ "$1" ==...
6,646
Posted By anbu23
$ cat check.sh str=`echo $1 | sed -e...
$ cat check.sh
str=`echo $1 | sed -e 's#[\][\]n# #g'`
echo $str>check.now
$ bash -x ./check.sh '/fin/app/01/scripts\\n/fin/app/01/sql'
++ echo '/fin/app/01/scripts\\n/fin/app/01/sql'
++ sed -e...
1,520
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"; ...
1,520
Posted By anbu23
Can you post what you tried?
Can you post what you tried?
6,099
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...
6,099
Posted By anbu23
$ echo $str | sed -e 's#\\n# #g'; ...
$ echo $str | sed -e 's#\\n# #g';
/fin/app/scripts /fin/app/01/sql
3,110
Posted By anbu23
If you don't have ">" in your input before...
If you don't have ">" in your input before vehicle then try
awk -v Tyre='Four' ' $0 ~ /Vehicle:/ { veh=$2 } $0 ~ "Tyre : "Tyre { print veh } ' file

Or

$ awk -v Tyre='Four' ' $0 ~ /Vehicle:/ {...
3,110
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
3,110
Posted By anbu23
Can you post what you have tried?
Can you post what you have tried?
2,314
Posted By anbu23
Can you post expected output?
Can you post expected output?
3,178
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,355
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...
4,939
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 ) {
> ...
2,147
Posted By anbu23
$ cat file =(root)NOPASSWD:/usr/bin/vim ...
$ cat file
=(root)NOPASSWD:/usr/bin/vim
=(ALL)NOPASSWD:/usr/bin/vim
=NOPASSWD:/usr/bin/vim
=(user)NOPASSWD:/usr/bin/vim
$ egrep '=(\(root\)|\(ALL\))?NOPASSWD' file
=(root)NOPASSWD:/usr/bin/vim...
3,877
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
3,877
Posted By anbu23
Can you post expected output?
Can you post expected output?
2,323
Posted By anbu23
Yes
Yes
3,441
Posted By anbu23
Yes but use double quotes for variable...
Yes but use double quotes for variable substitution
var=1
sed "${var}..." file
3,441
Posted By anbu23
You can add line number like this to run...
You can add line number like this to run substitute only on first line
sed -i "1{s/{+//;s/+}//;}" error.txt
3,322
Posted By anbu23
$ echo '[string 1 ] apple [ string 2]' | perl -pi...
$ echo '[string 1 ] apple [ string 2]' | perl -pi -e ' s/[[][^]]*]//g; '
apple
3,019
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...
Showing results 1 to 25 of 500

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