[oak perl] Perl Script

kenneth Jideofor jideoforkc at yahoo.com
Thu Jun 16 02:37:03 PDT 2005


Hi George,

Good reading from you.
It's my pleasure having my name in your mailing list.

I believe this is a very good opportunity for me to
develop my self on Perl.
I look forward to getting what it takes to become a
Perl guru from the group.

Meanwhile, I have this task to perform and I believe
Perl will offer me a better solution to accomplishing
it.

I have tried doing it with an awk script but I
couldn't get exactly what I wanted.
I need an assistance on how to go about it with Perl
script.

I have a file (FILE1)made up of two columns of data.
Column 1 contains numbers while Column 2 contains
letters. FILE1 is as shown below:

FILE1:
__________________
7240185	A
	B
	C
7240943	C
7240207	A
	B
7240194	B
	C
7240190	A
	B
	C
____________________

I need to produce two files (FILE2 and FILE3)from
FILE1 based on the following conditions:

Each number in Column 1 is expected to have
corresponding letters A, B, and C in Column 2. I need
to print out to FILE2 all the numbers that do not have
their corresponding letters A, B, and C, while those
that have their corresponding letters A, B, and C
should be saved in FILE3.

>From FILE1, the following numbers
do not have their corresponding letters A, B, and C:

7240943
7240207
7240194

while the following numbers have their corresponding
letters A, B, and C

7240185
7240190

Hence, FILE2 should contain the following numbers:

7240943
7240207
7240194

while FILE3 should contain the following numbers:

7240185
7240190

Could anyone, please, assist me with a Perl solution
to perform this task?

Thanks.

Best regards,
Ken


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Oakland mailing list