[H-GEN] regular expressions

Tom Atkinson tom at tyco.net.au
Thu Aug 17 23:43:05 EDT 2000


[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics.  Please observe the list's charter.          ]

The following sed script will replace multiple instances of white space
with one 'a', for example:

sed 's/ */a/'

Tom


"Grant, Luke" wrote:
> 
> [ Humbug *General* list - semi-serious discussions about Humbug and ]
> [ Unix-related topics.  Please observe the list's charter.          ]
> 
> hi all,
> 
> i need some help with a regular expression i am using in a sed command.
> 
> i have an ls - alF pumped into a file and i wish to exchange the iregular
> sized white space for some sort of standard delimeter.
> I need something like the following which does multiple space chars instead
> of a single space char.
> I was under the impression that \s looked after white space but it would
> seem that i was wrong. Also ^t is no good cause these fields do not conform
> to true tabs or any such thing.
> 
> sed s/[" "]/\|/g .inputfile
> 
> any ideas?
> 
> Luke
> 
> --------------------------------------------
> Luke Grant
> Systems Administrator
> Seven Queensland.
> Maroochydore
> 140-142 Horton Pde.
> wk#  +61754301737
> mob# +61407317951
> -------------------------------------------
> 
> --
> * This is list (humbug) general handled by majordomo at lists.humbug.org.au .
> * Postings to this list are only accepted from subscribed addresses of
> * lists 'general' or 'general-post'.

--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.



More information about the General mailing list