Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Help for Unix text file processing
Do it with Perl. If you don't know it, it's time to learn.
This script will do it:
#!/usr/bin/perl -pw
chomp;
next if /^\s+$/;
$_ =~ s/^\s+(.*)$/$1\n/;
run as my_script file_to_fix.txt > fixed_file.txt
Jared
On Wednesday 06 June 2001 07:55, you wrote:
> > Hey all,
> >
> > I am looking for some commands like ( grep, egrep, sed etc) to do the
> > following on a Unix box.
> >
> > 1. Command to take out all the blank line from a text file. The blank
> > line may include tabs and whitespaces.
> > 2. Command to take out the trailing and starting blanks and tabs from the
> > each line of the text file.
> > 3. Command for the above two tasks combined.
> >
> > Thanks in advance.
> >
> > Dharminder Kumar
>
> This e-mail and any attachments may contain confidential and privileged
> information. If you are not the intended recipient, please notify the
> sender immediately by return e-mail, delete this e-mail and destroy any
> copies. Any dissemination or use of this information by a person other than
> the intended recipient is unauthorized and may be illegal. Unless otherwise
> stated, opinions expressed in this e-mail are those of the author and are
> not endorsed by the author's employer.
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Jared Still INET: jkstill_at_cybcon.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Thu Jun 07 2001 - 05:15:52 CDT