I need to have the script search for 'LKTA' in the line. If it contains text, serialize the number portion starting at 1 and ending at 4. when it hits the fifth instance of 'LKTA', start back at 1 (loop until complete basically). If it doesn't contain the string 'LKTA', simply print the line.Name - John filename "LKTA_mic4.cfg"; } Name - Tim filename "LKTA_mic2.cfg"; } Name - Jane filename "LKTA_mic1.cfg"; } Name - Jim filename "LKTA_mic3.cfg"; } Name - Don filename "LKTA_mic1.cfg"; } Name - Cody filename "LKTA_mic4.cfg"; }
My knowledge of Perl is limited, and the scripts I have been trying to write are a dismal failure. I think the best method for this would be to delete the number, and then just run a serializing loop printing 1 through 4. Any help you have to offer would be very nice of you.Name - John filename "LKTA_mic1.cfg"; } Name - Tim filename "LKTA_mic2.cfg"; } Name - Jane filename "LKTA_mic3.cfg"; } Name - Jim filename "LKTA_mic4.cfg"; } Name - Don filename "LKTA_mic1.cfg"; } Name - Cody filename "LKTA_mic2.cfg"; }
In reply to serialze text in a file by TheBigAmbulance
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |