LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Bash. Remove from text table (https://www.linuxquestions.org/questions/programming-9/bash-remove-from-text-table-842828/)

Algis 11-07-2010 01:51 AM

Bash. Remove from text table
 
Hi. Let's say i have a table in a text file.
How can i remove from that table for example "SLS= " if the value is empty? Is it possible to do it in bash awk or sed?
Sorry for my english.

http://dl.dropbox.com/u/4110369/test.txt

10.25 SLS=* G.V.=* BBU=122 G.V.=14
10.28 SLS=196 G.V.=198 BBU=* G.V.=*
10.08 U.T.=* I.M=--
10.15 U.T.=-0.522 I.M=*

Algis 11-07-2010 02:13 AM

Solved by converting to other encoding and:
Code:

cat /tmp/whattoremove.txt | while read line; do sed -i "s|$line|g" /tmp/test.txt; done
Inside whattoremove.txt: SLS= |


All times are GMT -5. The time now is 07:37 AM.