![]() |
Re: newbie question about removing un needed extra lines
Scott Taylor wrote:
> > I've just started learning perl, and had two questions. One, what is > the best way to open a text file and remove all of the empty lines? > Example: > > a@a.com > b@b.com > > c@c.com > > d@d.com > > should turn into > > a@a.com > b@b.com > c@c.com > d@d.com > > > Also, what is the best source to learn perl? I've heard that the > O'Reilly Books are supposed to be very helpful. Can anyone recommend a > good web source with tutorials for newbies? > > Thanks in advance, > > Scott Taylor > perl -i -n -e 'print if ! /^$/;' I'll leave it up to you to look at the perl docs for an explaination. Look at man perl, man perlrun, man prelregquick, and man perlregtut. |
| All times are GMT. The time now is 11:21 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.