I want to change the format of each line in a file, and also run another lookup in one of the mapped groups.
As an example, I could have a simple three-column CSV file (without screens), which I would like to place in a different format.
sed -r 's/^([a-z]+),([a-z]+),([a-z]+)$/\1: \3 (\2)'
However, I also want to remove all the vowels from the second column, i.e. run s/[aeiou]//gon \2.
Is there a good solution to this nested permutation problem? Suppose both replacements are complex, and this was just an example.
My sed is not GNU sed version 4.0.
source
share