[Cialug] text munging

Dave Weis djweis at internetsolver.com
Thu Oct 26 07:13:30 CDT 2006


I have a small file processing problem. I have a file consisting of rows 
like this:
DESMIAAW	RT 6650 ASHWORTH RD	WDMNIAAQ		410701	410702	410704	410801 
410803	411101

DESMIAAW	DSLAM 7410 ASPEN DR	WDMNIAIA	ADSL	410801					
The first row has a variable number of 6 digit numbers at the end, the 
row after doesn't have that. I need to end up with the row "normalized" 
so if it gets in a row with 6 numbers at the end, I want six rows out 
with each number in the sequence at the end. There can be up to 9 of the 
numbers at the end.

I can do something similar in perl or awk but never bothered to learn 
how to do the variable number of repeating numbers bit.


More information about the Cialug mailing list