LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How exclude | from txt.file using awk or sed? (https://www.linuxquestions.org/questions/programming-9/how-exclude-%7C-from-txt-file-using-awk-or-sed-475853/)

sarajevo 08-21-2006 06:47 AM

How exclude | from txt.file using awk or sed?
 
Hi, I have to ask something related to awk programming. How exclude | in next line
|538|5431|205430|115602554343123|53791543454351423|94545|4555|52554|

and get a line without | just spaces between numbers like below.
538 5431 205430 115602554343123 53791543454351423 94545 4555 52554

I need this because a example without a | is possible to filter in awk or using sort command.

Does anybody know how to do this.

Regards.

pwc101 08-21-2006 06:53 AM

you could pipe the data into tr to replace the | with a space:
Code:

cat <filename> | tr "|" " " | awk...

sarajevo 08-21-2006 07:26 AM

Quote:

Originally Posted by pwc101
you could pipe the data into tr to replace the | with a space:
Code:

cat <filename> | tr "|" " " | awk...

Thanks pwc101.

Regards


All times are GMT -5. The time now is 12:33 AM.