bulgin24 has asked for the wisdom of the Perl Monks concerning the following question:
Hello. I'm pretty sure this can be a snap for perl. I have multiple files with the following types of text data from which I must iterate the data and expand the content into a new file. So, for example, here is a snippet of data (lines without parentheses address data and their associated city/state/zip should be ignored): turn this:
into this:432 10TH ST APT (Range 2A - 2B) BROOKLYN NY 10598-6601 432 10TH ST APT (Range 3A - 3B) BROOKLYN NY 10598-6601 432 10TH ST APT (Range 4A - 4B) BROOKLYN NY 10598-6605 432 10TH ST APT (Range 5A - 5D) BROOKLYN NY 10598-6605 432 10TH ST APT 6A BROOKLYN NY 10598-6605
432 10TH ST, APT 2A, BROOKLYN NY 10598-6601 432 10TH ST, APT 2B, BROOKLYN NY 10598-6601 432 10TH ST, APT 3A, BROOKLYN NY 10598-6601 432 10TH ST, APT 3B, BROOKLYN NY 10598-6601 432 10TH ST, APT 4A, BROOKLYN NY 10598-6605 432 10TH ST, APT 4B, BROOKLYN NY 10598-6605 432 10TH ST, APT 5A, BROOKLYN NY 10598-6605 432 10TH ST, APT 5B, BROOKLYN NY 10598-6605 432 10TH ST, APT 5C, BROOKLYN NY 10598-6605 432 10TH ST, APT 5D, BROOKLYN NY 10598-6605
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extract data from txt file
by davido (Cardinal) on Nov 30, 2019 at 05:13 UTC | |
by jdporter (Paladin) on Dec 02, 2019 at 13:41 UTC | |
by karlgoethebier (Abbot) on Nov 30, 2019 at 10:47 UTC | |
by holli (Abbot) on Nov 30, 2019 at 15:16 UTC | |
by karlgoethebier (Abbot) on Nov 30, 2019 at 16:32 UTC | |
|
Re: Extract data from txt file -- oneliner
by Discipulus (Canon) on Nov 30, 2019 at 14:15 UTC | |
|
Re: Extract data from txt file
by NetWallah (Canon) on Nov 30, 2019 at 04:45 UTC | |
|
Re: Extract data from txt file
by Marshall (Canon) on Nov 30, 2019 at 02:31 UTC | |
by Anonymous Monk on Nov 30, 2019 at 20:50 UTC | |
|
Re: Extract data from txt file
by Anonymous Monk on Nov 29, 2019 at 22:12 UTC |