nsyed has asked for the wisdom of the Perl Monks concerning the following question:
Problem: 1. Generate a 2 digit random number. Replace the first two digits in row 1 (e.g 57) with the new number. Use the same generated number for next two rows. Repeat the process for next 3 rows and so on, till EOF. 2. generate random number to replace the last two digits in row 2 & 3 then repeat the process for 5 & 6 and so on, till EOF. The result file will look like this. Let's say we generated a random number 12 and then next random number is 22. Also last two digits were replaced with the randomly generated numbers.57KXNWLRZWJ3 057E8bf0D030 057E8bf0D032 58KXNWLRZWKB 058E8bf0D02A 058E8bf0D02C
12KXNWLRZWJ3 012E8bf0D011 012E8bf0D067 22KXNWLRZWKB 022E8bf0D020 022E8bf0D023
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Search and replace text
by swampyankee (Parson) on Jan 26, 2006 at 23:20 UTC | |
|
Re: Search and replace text
by BrowserUk (Patriarch) on Jan 26, 2006 at 23:20 UTC | |
by ikegami (Patriarch) on Jan 26, 2006 at 23:31 UTC | |
by BrowserUk (Patriarch) on Jan 26, 2006 at 23:53 UTC | |
|
Re: Search and replace text
by ikegami (Patriarch) on Jan 26, 2006 at 23:21 UTC | |
by nsyed (Novice) on Jan 27, 2006 at 04:00 UTC | |
|
Re: Search and replace text
by nsyed (Novice) on Jan 27, 2006 at 04:02 UTC | |
by BrowserUk (Patriarch) on Jan 27, 2006 at 04:23 UTC |