Artificial intelligent assistant

Convert two rows to two columns I would like to convert every two rows to two columns using `awk`. input.txt: # Query: gi|11465907|ref|NC_001872.1| Chlamydomonas eugametos genome, complete genome # 0 hits found # Query: gi|11465922|ref|NC_000892.1| Pedinomonas minor genome, complete genome # 1 hits found output.txt: Chlamydomonas eugametos genome 0 Pedinomonas minor genome 1

Assuming that your input file is consistent:


awk -F'[|,]' '/genome/ {printf "%s ", $5; next} {print substr($1,3,1)}' input.txt > output.txt
Chlamydomonas eugametos genome 0
Pedinomonas minor genome 1

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 84f1974ffa425111247abcc6b442ef9e