Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Help parsing a ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 2158 of 2241
Post > Topic >>

Help parsing a file

by juanpo@[EMAIL PROTECTED] Feb 11, 2008 at 10:59 AM

Hi, I'm trying to parse a file that looks like this to create 2
different files based on the first 3 characters

FL1ABC
LG1XYZ
LG2DBA
LG3PYZ
FL1CBA
LG1QWE
LG2ZXC

The first file will have all records starting with FL1 like this:
FL1ABC
FL1CBA

The second file will need to have the FL1 records appended to each of
the LG records below it like this:

FL1ABCLG1XYZ
FL1ABCLG2DBA
FL1ABCLG3PYZ
FL1CBALG1QWE
FL1CBALG2ZXC

Is there a way to easily build this logic using awk?

Thanks in advance for any helps you could provide.

Juan.




 6 Posts in Topic:
Help parsing a file
juanpo@[EMAIL PROTECTED]   2008-02-11 10:59:37 
Re: Help parsing a file
Ed Morton <morton@[EMA  2008-02-11 13:08:26 
Re: Help parsing a file
juanpo@[EMAIL PROTECTED]   2008-02-11 12:14:54 
Re: Help parsing a file
Ed Morton <morton@[EMA  2008-02-11 15:41:55 
Re: Help parsing a file
juanpo@[EMAIL PROTECTED]   2008-02-13 12:28:51 
Re: Help parsing a file
Ed Morton <morton@[EMA  2008-02-13 15:40:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 12:35:19 CDT 2008.