Hi Team,
I am trying hard to find a way I can filter a line as below:
If I have a line as
/abc /def 123:/ghi /jkl 456:/mno /pqrs 7890:/tuvw /xyz
I am expecting my output to be as below:
/abc /def /jkl /pqrs /xyz
basically I want to ignore anything preceding or succeeding colon (":") from a line.
Please help.
Aia
2
Please, try:
perl -pe 's/\s\d+:\/\w+//g' SiddhVi.file
RudiC
3
sed
approach:
sed 's/\(^\| \)[^ ]*:[^ ]*\( \|$\)/ /g' file
/abc /def /jkl /pqrs /xyz