Tag Info

New answers tagged

0

Will strip also empty lines grep -E -v "^\s*($|;)" php.ini


2

To replace first 10 digits with * if, and only if, the number has exactly 14 digits: sed 's/\([^0-9]\)[0-9]\{10\}\([0-9]\{4\}\)\([^0-9]\|$\)/\1**********\2\3/g' Example: $ echo 'foo bar 38012345678901 2014-02-11 22:23, 1134-53553, 4-5-6-7-7-2, 28012345678901,,,,, 3801234567890123456789 stuff' | \ sed ...


0

You can do it: cat gene_map_table_fb_2014_01_short.tsv |sed '1d' |awk {'print $2'} |awk 'BEGIN{FS=":"} {print $2}' |sed s/._//g At first cat your file, Then delete first line (header of columns with d1) , then print all of column, then seprate 4_FBgn0035847 with awk 'BEGIN{FS=":"} {print $2}' Then eliminate number_ with sed s/._//g Output is: ...


0

Using awk This creates tab-separated output: $ awk -v OFS="\t" 'NR==FNR{a[$1]=$2;next} FNR==1{print;next} {sub(/intron_/, "", $2); sub(/:.*/,"",$2);if ($2 in a) $2=a[$2];print}' gene_map_table_fb_2014_01_short.tsv HC25_LNv_ZT02_intron_results.txt bundle_id target_id length eff_length tot_counts uniq_counts est_counts eff_counts ambig_distr_alpha ...


2

It looks like your output is in some way encoded. You can try to pipe the output from grep through sed, it that is the only sequence you have to change: echo 'AAA"& #x5c;"BBB"& #x5c;"CCC' | sed 's/"& #x5c;"/\//g' will give you AAA/BBB/CCC


2

An awk solution: $ awk -v pat="$(awk '/SETTINGS START/,/SETTINGS END/' file2)" -v p=1 ' /SETTINGS START/{p=0};p;/SETTINGS END/{print pat;p=1}' file1 > file3 ANJALI NISHA // +++ CUSTOMIZATION SETTINGS START +++ WELCOME ALL // +++ CUSTOMIZATION SETTINGS END +++ PREETI MONA



Top 50 recent answers are included