Search Results

Search: Posts Made By: anbu23
4,418
Posted By anbu23
$ sort -t"," -k1,1 -u file ...
$ sort -t"," -k1,1 -u file
ENSG00000003137,ENST00000001146
ENSG00000003402,ENST00000309955
6,516
Posted By anbu23
ls | awk -F"status_|[.]log" ' { print $2 }...
ls | awk -F"status_|[.]log" ' { print $2 } '
4,971
Posted By anbu23
Can you post expected output?
Can you post expected output?
2,674
Posted By anbu23
Can you post what you tried?
Can you post what you tried?
6,205
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" ==...
8,483
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...
2,776
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"; ...
2,776
Posted By anbu23
Can you post what you tried?
Can you post what you tried?
7,777
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...
7,777
Posted By anbu23
$ echo $str | sed -e 's#\\n# #g'; ...
$ echo $str | sed -e 's#\\n# #g';
/fin/app/scripts /fin/app/01/sql
4,684
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:/ {...
4,684
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
4,684
Posted By anbu23
Can you post what you have tried?
Can you post what you have tried?
3,041
Posted By anbu23
Can you post expected output?
Can you post expected output?
4,894
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,929
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...
5,664
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,821
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...
4,940
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
4,940
Posted By anbu23
Can you post expected output?
Can you post expected output?
3,036
Posted By anbu23
Yes
Yes
4,686
Posted By anbu23
Yes but use double quotes for variable...
Yes but use double quotes for variable substitution
var=1
sed "${var}..." file
4,686
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
4,561
Posted By anbu23
$ echo '[string 1 ] apple [ string 2]' | perl -pi...
$ echo '[string 1 ] apple [ string 2]' | perl -pi -e ' s/[[][^]]*]//g; '
apple
4,275
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 02:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy