Tag Info

New answers tagged

1

If there is no other limitation here your script sed '/^HEADER/{:1;N;/TAIL/!b1;/DOG/d}' text Just for fun other variants of awk: one: awk ' BEGIN{prn=1} /^HEADER/{block=1} block{ if(/DOG/) prn=0 if(!/^TAIL/){ line=line $0 "\n" next } } prn{print line $0} /^TAIL/{ ...


2

With perl: perl -0777 -lne 'print for grep !/DOG/, /^HEADER.*?TAIL.*?\n/mgs' your-file With awk: awk '! inside {if (/^HEADER/) {inside = 1; skip = 0; content = ""} else next} /DOG/{skip = 1; next} ! skip {content=content $0 "\n"} /^TAIL/ {if (!skip) printf "%s", content; inside = 0}' your-file


4

With the subsequent awk program: awk ' BEGIN { FS = "([[:space:]]+|[|])" } NR==FNR { id[$1] ; next } /^>>/ && $2 in id { data = $2 ; f = 1 } f && /^[0-9]/ { data = data " : " $10 " " $11 } f && !NF { f = 0 ; print data } ' FileB FileA you will get this output: AT5G46880.1 : 317 ...


0

Try this grep -A4 -f <(sed 's/^/^>> /' fileB) fileA | sed -r '/^>>/! s/(\S+\s+){8}((\S+\s+){3}).*/\2/ s/[][>.-]*\s*//'


3

You can use this if you are on a little endian system: iconv -f utf-8 -t ucs-4le | od -tx4 or this if you are on a big endian system: iconv -f utf-8 -t ucs-4be | od -tx4



Top 50 recent answers are included