in reply to Re^2: Get data from a file to search and replace within a second file
in thread Get data from a file to search and replace within a second file
2. I tried the code from almut. It works but it will not distinguish between c1 and c11. In other words when C11 is found d1 is added within the 11. The final result is "c1 d11"My solution also does not distinguish between c1 and c11. You can add \b anchors, as GrandFather has (see perlre):
s/\b$k\b/$data{$k}/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Get data from a file to search and replace within a second file
by educated_foo (Vicar) on Mar 24, 2010 at 14:21 UTC |