Reputation: 15
I've this strings in a file that looks like aaaaa;bbbbbbb;ccccc\n
and aaaaa;bbbbbb\n
the idea is only to show the text between the last semicolon and newline. Output will be
ccccc
bbbbb
etc.
Thought that I could do it with sed -e [:]$ | awk -F '\n' {print $1}
Upvotes: 1
Views: 489
Reputation: 64603
There are many ways to solve the task:
sed 's/.*;//'
awk -F';' '{print $NF}'
rev | cut -d';' -f 1 | rev
Upvotes: 3