[EMAIL PROTECTED] wrote:
> Help. I'm a frustrated newbie who wants to use Perl to make my life easier.
>
> The following simple task is only one small part of a program I'm trying to
> put together to automate some things I currently do manually.
>
> I have a file whose format looks like this:
>
> name1 name2 name3
> name4 name5 name6, etc.
>
> The names are separated by spaces. I need the names to be one name per
> line, like this:
>
> name1
> name2
> name3, etc.
l_welk.txt:
an-a-one an-a-two an-a-three
an-a-four an-a-five an-a-six
an-a-seven an-a-eight an-a-nine
Greetings! E:\d_drive\perlStuff>perl -w
open IN, 'l_welk.txt' or die "Too ossified, I guess $!";
while (<IN>) {
s/\s+/\n/g;
print;
}
^Z
an-a-one
an-a-two
an-a-three
an-a-four
an-a-five
an-a-six
an-a-seven
an-a-eight
an-a-nine
Joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>