TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [TCLUG:15822] perl and text-delim database
Look in your Perl documentation under Text::ParseWords.
i.e.,
Use Text::ParseWords;
.
.
.
while (<IN>) {
@words = "ewords($delim, $keep, @lines);
}
> ----------
> From: Ben Luey[SMTP:lueyb@gridley.ACNS.Carleton.edu]
> Reply To: tclug-list@mn-linux.org
> Sent: Sunday, April 09, 2000 11:40 PM
> To: tclug-list@mn-linux.org
> Subject: [TCLUG:15822] perl and text-delim database
>
> I've got I think a simple perl question:
>
> I've got a mailing list in a text-delim format:
>
> name1<tab>address1<tab>stuff1
> name2<tab>address2<tab>stuff2
> ...
>
>
> How can I get that into an array or something in perl, so I can control
> each field?
>
> Right now I have
>
> open(list, "file"){
> @list = <list>
>
> but I don't know how to manipulate each field in a row
>
> ex:
>
> print (@list[1]);
>
> prints the 2nd line, but how I can print out the 2nd field of the second
> line?
>
>
> Any links to good web-sites with tutorials would be great.
>
> Thanks,
>
> Ben
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tclug-list-unsubscribe@mn-linux.org
> For additional commands, e-mail: tclug-list-help@mn-linux.org
>