Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.
Replacing spaces in filename
Name: B Date: April 11, 2003 at 01:53:47 Pacific OS: 9.0 CPU/Ram: P 4
Comment:
Hello,
I have hundreds of files that contain spaces. I want to have a script that will replace these spaces with a hyphen or something similar. Any ideas? I started by writing a bash script:
for i in `ls` do ..... done
but, i gets split up like this (for example): The original file name is Christmas Eve 001.jpg
so, $i gets set to Christmas, Eve, 001.jpg separately. Any help is greatly appreciated!!!!!!!!!!
Name: 3Dave Date: April 11, 2003 at 02:33:08 Pacific
Reply:
Just use the "rename" command: # rename foo bar /*.doc will replace all instances of "foo" in file names with "bar" for all ".doc" files, eg: foofoo.doc -> foobar.doc
The command you want will be something like: # rename " " "_" ./*
Summary: This post seems a little off color, but I need to know how to double space in open office... My teacher won't accept anything that isn't double spaced. I don't wanna go back to Word, but I am afraid t...
Summary: Hi, How can i determine the available free space in cd. i hav tried with " df -h " and " du -h " command. it is showing 0 bytes free where as i hav wrote only 125mb data ...
Summary: Your console isnt broken. You just dont have the slightest idea what you are doing. If you are getting: "cp: missing destination file" Then you are only typing in: "cp filename" If you typed in "cp fi...