lazy has asked for the wisdom of the Perl Monks concerning the following question:
i'm reading a header line(column name) from a file with the below code. i tried it with split() and returning values i need to store it in an array but its getting stored as single value in array ! can i use loop to store values in arrray or while reading itself i can do that ? needed help in this...
open (MYFILE, 'Data.txt'); $ColumnNames = <MYFILE>; @colarray = split ',', $ColumnNames;
this is what i read
Id,Name,Sex,RegDate,LeaveDate,Time,Dummy
this is the desired output which i should print it on file using Tie::File
Id,Name,Sex,RegDate,LeaveDate,Time
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reading line and Spliting it
by Corion (Patriarch) on Jul 17, 2014 at 07:06 UTC | |
by lazy (Novice) on Jul 17, 2014 at 07:19 UTC | |
by Corion (Patriarch) on Jul 17, 2014 at 07:23 UTC | |
by Anonymous Monk on Jul 17, 2014 at 08:42 UTC | |
by lazy (Novice) on Jul 17, 2014 at 10:18 UTC | |
by Corion (Patriarch) on Jul 17, 2014 at 10:25 UTC | |
| |
by jellisii2 (Hermit) on Jul 17, 2014 at 12:52 UTC | |
|
Re: Reading line and Spliting it
by gurpreetsingh13 (Scribe) on Jul 17, 2014 at 09:55 UTC | |
by lazy (Novice) on Jul 17, 2014 at 10:22 UTC | |
|
Re: Reading line and Spliting it
by bulrush (Scribe) on Jul 17, 2014 at 10:51 UTC | |
by GotToBTru (Prior) on Jul 17, 2014 at 13:50 UTC |