Posts Tagged With: whitespace

Delete Leading Whitespace Using Sed

Tagged with: , , , , ,

Delete leading whitespace (spaces/tabs/etc) from beginning of each line. Same as yesterday’s command – but using sed


cat file.txt | sed -e 's,^ *,,'

Credit: Vivin

No Comments »

Delete Leading Whitespace

Tagged with: , , , , ,

Delete leading whitespace (spaces/tabs/etc) from beginning of each line


ruby -pe 'gsub(/^\s+/, "")' < file.txt
1 Comment »

Remove Empty Characters at End of Lines

Tagged with: , , , ,

Remove empty characters at the end of each row


sed -e 's/ *$//' file.txt
No Comments »