Tagged Questions
1
vote
1answer
56 views
Why is it that , to newline is working but newline to , is not working sed?
I have got a text file with a list of first names, and I am trying to replace newline with ,.
Here is the command I am using
sed 's/\
/,/g' file
while the reverse is working
sed 's/,/\
/g' file
...
3
votes
2answers
286 views
How to skip file in sed if it contains regex?
I currently use the following simplified command to remove trailing whitespace and add a newline at end of file where needed:
find . -type f -exec sed -i -e 's/[ \t]\+\(\r\?\)$/\1/;$a\' {} \+
As ...
3
votes
2answers
5k views
Removing all spaces, tabs, newlines, etc from a variable?
This is the error I am getting and it's failing because of a variable whose value is supposed to be 2 (I am getting this using a select * from tabel).
I am getting spaces in that variable.
+ 0 !=
...