Community Page
- www.tech-recipes.com/ Jump to website »
-
Subscribe -
Community
-
Top Commenters
-
Popular Threads
-
Recent Comments
- Thank you so much
- hey
- Thanks mate, Just what I was looking for. It seemed to be a different way of doing things in Leopard than previous versions. Cheers, Mitch
- thanks, i couldnt remember.
- I did this in Garage band, but if forced me to trip the song to 8 seconds in order to send it to itunes ringtones - any ideas on this? Using the new 3GS.
5 years ago
5 years ago
cat foo | col -b > foo2
6 months ago
2 months ago
5 years ago
:%s/<control-v><control-m>//g
^M is the result of a control V, control M at the end of the line. if you actually hit control-v then control-m, "^M" will appear and will get rid of the character at the end of the line. hope this helps someone!!!
2 months ago
roy@roy.com
5 years ago
col -bx <dosfile> newfiledoes the biz. too :)
5 years ago
4 years ago
Right On!
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
THere is lot of non-continous blank lines in my shell. I want to find the blank line and I want to remove it. What is the command for that?
Sasi, India
3 years ago
:%s/^$//gwill find blank lines and make them disapear.
2 years ago
While I can do each one individually by :%s/^M//g I would like to know if there is an easy command line execution to serarch for any files containing the errors and correct them.
I tried this for all *.sql files in a given directory, but it didn't work:
for name in `ls *.sql` ; do sed 's/^M//' $name > ${name/.sql/N.sql} ; mv ${name/.sql/N.sql} $name ; done
If anyone has a suggestion or knows a simple script that can be run please let me know.
Thanks
8 months ago
So, to change one file:
cat fileName | sed s/<ctrl-v><ctrl-m>//g >tmp && mv tmp fileName
Do NOT try to read from and write to the same file in one pipe, or you'll blank the file
To change all files in a directory with the .sql ending, run the following script whilst inside that directory:
#/bin/ksh
for fileName in $(ls *.sql); do
cat $fileName | sed s/^M//g >tmp && mv tmp $fileName
done
(bear in mind to enter ^M you need to enter <ctrl-v><ctrl-m> as above.
Hope that helps people
-phobiandarkmoon
8 months ago
:%s/.$//
8 months ago
7 months ago
6 months ago
5 months ago
4 months ago
4 months ago
:%s/\r//g
btw other systems then *nix are treating newlines differently :P
2 months ago
2 months ago
:%s@^M$@@g
1 month ago
1 month ago