I have file containing text like this
4539 DECK AAA
OO-99999999-99999999-99999999-99999999 -99999999-99999999 259800
259800 259800-99999999-99999999 4539 DECK ABC
OO-99999999-99999999-99999999-99999999 -99999999-99999999 259800
259800 259800-99999999-99999999 4539 DECK ABA
OO-99999999-99999999-99999999-99999999 -99999999-99999999 259800
259800 259800-99999999-99999999 4539 DECK ABD
OO-99999999-99999999-99999999-99999999 -99999999-99999999 259800
259800 259800-99999999-99999999
I want to extract a selected port from it. So the output must look like this. Without preceding and trailing spaces tabs
AAA
ABC
ABA
ABD
I used this but it select entire line after text. Is there any way using only sed. Not interested in any other solution
sed "s/.*DECK[[:blank:]](.[A-Z])*/\1/"