SUMMARY: trailing space

From: Rami Aubourg <rami.aubourg_at_ifrance.com>
Date: Fri Mar 08 2002 - 08:26:40 EST
Hello, gurus, and thanks again to all who replied so quickly:

D.Glass, J.Riddoch, W.Heukels, L.Hecking, S.Hunt, J.Birtley, B.Hutin, 
,M.Pfeiffer, etc...

The most common and straightforward anwer to remove the trailing spaces 
on all line of a file was:


cat <infile>  | sed -e 's/ *$//' > <outfile>


What this means:
-e    execute this command for every line
s     substitue
/ *$/ any number of spaces, followed by the end of the line...
//    ...with nothing

(Quoted W.Heukels for the explanation)


Thanks again. Original post below.

Rami Aubourg

************************************************************

Hi, gurus,

I'm trying trying to put up a shell script to clean up an ASCII file I have.
The problem I have right now is that each line is padded with spaces
until the end of each line. I would need to remove those trailing
spaces, but am not very good at sed and awk.
If someone has a suggestion, I'd be grateful.

Rami Aubourg





 
______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Fri Mar 8 07:27:12 2002

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:36 EST