sajjad has asked for the wisdom of the Perl Monks concerning the following question:
I want to replace this pattern with:.comm _resultAvg,8,4 .comm _resultSwap,8,4 .comm _resultMax,20,4
How to perform this task using regex? That is, how to find the numeric e.g. 20 and divide it by 4 and then put corresponding # of ".data.32 0" lines after starting with relevant symbol "_resultMax". regards.data _resultAvg: .data.32 0 .data.32 0 .data _resultSwap: .data.32 0 .data.32 0 .data _resultMax: .data.32 0 .data.32 0 .data.32 0 .data.32 0 .data.32 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: replace a line with lines based on information extracted from these line using Perl
by tybalt89 (Monsignor) on Nov 04, 2018 at 15:04 UTC | |
by sajjad (Initiate) on Nov 04, 2018 at 17:05 UTC | |
|
Re: replace a line with lines based on information extracted from these line using Perl
by Corion (Patriarch) on Nov 04, 2018 at 15:20 UTC | |
by harangzsolt33 (Deacon) on Nov 05, 2018 at 02:46 UTC | |
by Corion (Patriarch) on Nov 05, 2018 at 08:15 UTC |