Mailinglist Archive: opensuse (2488 mails)
| < Previous | Next > |
Re: [opensuse] Bash script help needed
- From: Anders Johansson <andjoh@xxxxxxxxxx>
- Date: Mon, 5 Feb 2007 20:14:39 +0100
- Message-id: <200702052014.39110.andjoh@xxxxxxxxxx>
On Monday 05 February 2007 20:09, Brian Jackson wrote:
> On Monday 05 February 2007 11:01, Jan Karjalainen wrote:
> > Somehow all these examples add the ",on" on a new line after each
> > line, like this:
> >
> > 208.34.234.48-208.34.234.63
> > ,on
> > 208.34.235.32-208.34.235.63
> > ,on
> > etc...
> >
> > I want them to look like this:
> > 208.34.234.48-208.34.234.63,on
> > 208.34.235.32-208.34.235.63,on
> > etc...
>
> Did your input file come from a DOS (ie windos) computer?
>
> The sed examples work just as well as the perl on I mentioned. if your
> file does have ^M's in it, you can strip them with this
>
> perl -pi -e 's/^M//g; s/$/,on' FILE
or
dos2unix filename
dos2unix is in the dos2unix package, which should be installed by default
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
> On Monday 05 February 2007 11:01, Jan Karjalainen wrote:
> > Somehow all these examples add the ",on" on a new line after each
> > line, like this:
> >
> > 208.34.234.48-208.34.234.63
> > ,on
> > 208.34.235.32-208.34.235.63
> > ,on
> > etc...
> >
> > I want them to look like this:
> > 208.34.234.48-208.34.234.63,on
> > 208.34.235.32-208.34.235.63,on
> > etc...
>
> Did your input file come from a DOS (ie windos) computer?
>
> The sed examples work just as well as the perl on I mentioned. if your
> file does have ^M's in it, you can strip them with this
>
> perl -pi -e 's/^M//g; s/$/,on' FILE
or
dos2unix filename
dos2unix is in the dos2unix package, which should be installed by default
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
| < Previous | Next > |