Google Answers Logo
View Question
 
Q: For palitoy-ga only ( Answered 5 out of 5 stars,   1 Comment )
Question  
Subject: For palitoy-ga only
Category: Miscellaneous
Asked by: mickr-ga
List Price: $40.00
Posted: 12 Aug 2004 01:49 PDT
Expires: 11 Sep 2004 01:49 PDT
Question ID: 386843
Hi Palitoy,

I need another perl script. To process lots of files. To find the
files you can do a (OPEN, `find . -name '*rpt').

Each file will contain entries in columns like (tab or single or
multiple space seperated)

rubish a/b/c/d number rubish rubish rubish word
so an example would be

pin d/e/f/g -0.039 74.00 daft stupid Hello
pin g/h/i/j -0.40  56.00 joe  dave   Hello
pin d/d/d/g -0.139 74.00 daft stupid Hello

next file would be 

pin g/g/i/j -0.40  56.00 joe  dave   Hello1
pin d/e/f/g -0.059 74.00 daft stupid Hello1
pin g/g/g/j -0.40  56.00 joe  dave   Hello1

There will be lots of these files to process (200) but typically they
are small 30 lines or so.

What I want out is (tab seperated)

         Hello   Hello1
d/e/f/g -0.039   -0.059
g/h/i/j -0.40  
d/d/d/g -0.139
g/g/i/j          -0.40  
g/g/g/j          -0.40  

i.e. the match across files is on column 1 (d/d/d/g) only
If column1 matches a row that is already there put column2 on the same line.
If column1 does not match then add a new row.

Column2 goes under a column given by the name in column6. 
Column6 will be the same within each file but unique across files.

Does this make sense?

Thanks,

Mick

Request for Question Clarification by palitoy-ga on 12 Aug 2004 03:22 PDT
Hello Mick

Thanks for posting another question for me.  I will look at this this
afternoon and get back to you with any questions that I have.
Answer  
Subject: Re: For palitoy-ga only
Answered By: palitoy-ga on 13 Aug 2004 03:07 PDT
Rated:5 out of 5 stars
 
Hello Mick

Once again, thank-you for asking this question.

I have posted the script in the .zip file at this location for you to collect:
http://www.rh007b3221.pwp.blueyonder.co.uk/386843-ga.zip

As soon as you have rated the answer I will remove the link.

If you have any problems with the script please let me know and I will
do my best to fix them promptly.
mickr-ga rated this answer:5 out of 5 stars and gave an additional tip of: $30.00
SCript perfect as usual! 

Thanks,

Mick

Comments  
Subject: Re: For palitoy-ga only
From: palitoy-ga on 16 Aug 2004 02:34 PDT
 
Thanks for the 5-star rating and generous tip!  They are both appreciated.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy