CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Post deleted by onephattai

 



onephattai
Novice

Apr 23, 2009, 8:28 PM

Post #1 of 8 (788 views)
Post deleted by onephattai

 


ichi
User

Apr 23, 2009, 9:13 PM

Post #2 of 8 (785 views)
Re: [onephattai] How to remove fields in a file [In reply to] Can't Post

is it always the same format of 2 names with comma in between?
you can just do a split , then get rid of the elements you don't want. After that, join them back.


onephattai
Novice

Apr 23, 2009, 9:52 PM

Post #3 of 8 (784 views)
Re: [ichi] How to remove fields in a file [In reply to] Can't Post

How do you do a split on an array?
I tried this, but it did not work.

my @lines = <INFILE>;
($name, @scores) = split /(\d+)/, @line;


KevinR
Veteran


Apr 23, 2009, 10:34 PM

Post #4 of 8 (782 views)
Re: [onephattai] How to remove fields in a file [In reply to] Can't Post

You want to split $line if the "foreach" loop
-------------------------------------------------


onephattai
Novice

Apr 23, 2009, 11:01 PM

Post #5 of 8 (781 views)
Re: [KevinR] How to remove fields in a file [In reply to] Can't Post

I did this
($name, @scores) = split /(\d+)/, $line;

and the $name shows up correctly but @score is empty. Can you show me the correct way to do this?
Thanks,


KevinR
Veteran


Apr 24, 2009, 12:30 AM

Post #6 of 8 (778 views)
Re: [onephattai] How to remove fields in a file [In reply to] Can't Post

Sorry, I don't like when people delete their posts after asking a question, makes me suspicious they are cheating on something.
-------------------------------------------------


onephattai
Novice

Apr 24, 2009, 10:11 AM

Post #7 of 8 (769 views)
Re: [KevinR] How to remove fields in a file [In reply to] Can't Post

I got it to work. I didn't want other people wasting their times on the same problem. Smile


KevinR
Veteran


Apr 24, 2009, 1:40 PM

Post #8 of 8 (757 views)
Re: [onephattai] How to remove fields in a file [In reply to] Can't Post


In Reply To
I got it to work. I didn't want other people wasting their times on the same problem. Smile


If you say so. Crazy
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives