I want to identify a field in a line containing a string, and then move it to a different position. A line would look like this (sorry, I can't seem to type tabs in here)
string1 / string2 / blablaABCbla / string3
The idea is to locate the field containing ABC and move this field to the beginning or end of the line. How would I do this in bash, from stdout?
I'm trying to work this into a piped sequence - I was hoping for a clever command I didn't know about, or else something really sed-ugly.