Search Results

Search: Posts Made By: M Gruenstaeudl
1,966
Posted By M Gruenstaeudl
@Aia: Yes, perl seems to be the way to go here,...
@Aia: Yes, perl seems to be the way to go here, not sed. Thanks for your answer. It answered my question to the point.
perl -pi -le 's/(kw1.*?)kw2(.*?kw3)/$1qux$2/' infile
1,966
Posted By M Gruenstaeudl
Substitute first occurrence of keyword if occurrence between two other keywords
Assume a string that contains one or multiple occurrences of three different keywords (abbreviated as "kw"). I would like to replace kw2 with some other string, say "qux". Specifically, I would like...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 07:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy