Talk About Network

Google


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 > filtering for i...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 2082 of 2341
Post > Topic >>

filtering for identical field labels

by Al <palcibiades-first@[EMAIL PROTECTED] > Nov 30, 2007 at 10:03 AM

I'm having trouble figuring how to do the following.

I've a file like this:

***record***
TAG1 A
TAG2 B
irrelevant------------------
TAG2 C
TAG3 D
TAG4 E
#
***record***
TAG1 f
TAG2 g
TAG2 h
irrelevant------------------
TAG3 i
TAG4 j
#

So the record delimiter is actually #\***record***, and the field
delimiter
is \n.    The records are of variable lengths, and may contain multiple
identical field names, which I show above with the repetitions of tag2.

I am trying to get to a csv file from this, and can do most of it, but the
thing I am stuck on is how to deal with the multiple field names.

What I need to get to from the above is a file that looks like this:

A TAB B C TAB D TAB E
f TAB g h TAB i TAB j

The thing I can't figure out is how to check for two or more identical
field
names in a row in the input file, and then put the contents into the same
field in the csv file.

Regards, Al
 




 4 Posts in Topic:
filtering for identical field labels
Al <palcibiades-first@  2007-11-30 10:03:03 
Re: filtering for identical field labels
Janis <janis_papanagno  2007-11-30 04:52:58 
Re: filtering for identical field labels
Al <palcibiades-first@  2007-11-30 14:47:27 
Re: filtering for identical field labels
Janis <janis_papanagno  2007-11-30 07:34:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Wed Aug 27 18:00:48 CDT 2008.