[ale] Sed/Awk/PERL question

Richard Bronosky Richard at Bronosky.com
Tue Dec 1 14:04:36 EST 2009


I like where you were going with it, but I like to trust the system to
handle how to optimize the IO.

sed -i.bak -e 's/;$//' yourGiantFile

The option -i is edit in place. If you give it an extension, it makes
a backup. The BSD version of sed requires an space after the -i, the
GNU version requires there not be a space. Make sure to check man sed
before using it.

On Tue, Dec 1, 2009 at 10:20 AM, JK <jknapka at kneuro.net> wrote:
> cp yourGiantFile backupInCaseJKsIdeaTotallySucks
>
> sed -e 's/;$//' < yourGiantFile > newFile
>
> -- JK
>
>
> Bob Kruger wrote:
>> All;
>>
>> I have a 1.3GB text file that has multiple fields separated by semicolons.  Format follows:
>>
>> field1;field2;field3;...field24;
>> .
>> .
>> .
>> field1;field2;field3;...field24;
>>
>> I need a quick and dirty method to delete the last semicolon.
>>
>> Any ideas or thoughts?
>>
>> Thanks in advance for any assistance.
>>
>> V/r
>>
>> Bob
>>
>>
>>
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>> See JOBS, ANNOUNCE and SCHOOLS lists at
>> http://mail.ale.org/mailman/listinfo
>>
>>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>



-- 
.!# RichardBronosky #!.



More information about the Ale mailing list