Search Results

Search: Posts Made By: M Gruenstaeudl
1,723
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,723
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 08:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy