User Tools

Site Tools


sed:remove_whitespace_from_a_file

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sed:remove_whitespace_from_a_file [2019/12/10 18:25] petersed:remove_whitespace_from_a_file [2019/12/10 18:33] (current) – removed peter
Line 1: Line 1:
-====== SED - Remove whitespace from a file ====== 
- 
-===== Delete whitespace from begin of each line ===== 
- 
-<code bash> 
-cat input.txt | 's/^[ \t]*//' > output.txt 
-</code> 
- 
----- 
- 
- 
-===== Delete trailing whitespace from end of each line ===== 
- 
-<code bash> 
-cat input.txt | sed 's/[ \t]*$//' > output.txt 
-</code> 
- 
----- 
- 
-===== Remove leading and trailing whitespace from each line ===== 
- 
-<code bash> 
-cat input.txt | sed 's/^[ \t]*//;s/[ \t]*$//' > output.txt 
-</code> 
- 
- 
  
sed/remove_whitespace_from_a_file.1576002358.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki