Computing.Net > Forums > Unix > Script to prune a file

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

Script to prune a file

Reply to Message Icon

Original Message
Name: GKP
Date: April 4, 2005 at 08:56:58 Pacific
Subject: Script to prune a file
OS: MacOsX
CPU/Ram: G3 processor/640 MB SDRAM
Comment:

Hello

I have files in different formats which I'm
trying to prune down to get rid of
equivalent strings.

For example, a tab delimited file contains
the following:
a b
c b
c a
d e

In this instance I would like a output file that
just contains either a OR b OR c (because a,
b,c are equivalent as a finds b, c finds b
and c finds a) AND one of the letters d OR e
(i.e the output contains a and d for
example)

However, another file format that I have is
a b
c d
e c

In this case I want to output either a or b
AND d AND e so the file would contain a, d
and e for example(because c appears on more
than one line but d and e don't find each
other therefore aren't equivalent
themselves)

In some of my files there can be any number
of equivalent strings with all their
different combinations.

Thanks for any help,
Gayle


Report Offensive Message For Removal








Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge
Poll History




Data Recovery Software