Unix Shell - Re: substituting space with a pipe in a text file

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > December 2004 > Re: substituting space with a pipe in a text file





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: substituting space with a pipe in a text file
Janis Papanagnou

2004-12-29, 8:47 pm

Christian Schneider wrote:
> Thus spake mkumar200423@rediffmail.com (mkumar200423@rediffmail.com):
>
>
> | $ echo ADSSD SFDS ADSF FDDSF FDSFS | sed 's/ /|/g'
> | ADSSD|SFDS|ADSF|FDDSF|FDSFS
> | $ echo AAA BBB CCC DDD EEE 123 | sed 's/ /|/g'
> | AAA|BBB|CCC|DDD|EEE|123


sed 's/ \+/|/g'

If you have multiple spaces as indicated in the request.

Janis
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com