Search code examples
androidbashoutputcut

Select text between specific columns in everyline of the output


I have a output something like :

xxxxxxxxxFOOxxxxxxxxxxxx
blablabl BAR lablblablaa
=========tst============

what can i do for have something like :

FOO
BAR
tst

Which command should i use for only display text between specific column in all line?

cut -d will not work cause its not the same delimiter in every lines ..

PS : Its on android and few command missed ..

thx for helping ...


Solution

  • cut -d will not work cause its not the same delimiter in every lines ..

    Yes but cut -c10-12 does the job, extracting only the 10th, 11th and 12th character of each line. You don’t provide examples of longer lines, so it is not clear what you want to do in that case.