Skip to main content
1 of 4
George Vasiliou
  • 8.1k
  • 3
  • 24
  • 43

Check also this awk simple solution. Will remove the string no matter where it is and should be portable:

$ echo "test.xyz|test3.abc|test5232.lop|filename.test|file.text|qwerty.bat" |awk -F"test5232.lop." '{printf("%s%s\n",$1,$2)}' test.xyz|test3.abc|filename.test|file.text|qwerty.bat 
George Vasiliou
  • 8.1k
  • 3
  • 24
  • 43