View previous topic :: View next topic |
Author |
Message |
supermihi Guru
Joined: 09 Feb 2005 Posts: 348
|
Posted: Fri Feb 22, 2008 12:32 pm Post subject: [SOLVED] copy files to windows when filenames contain :?\* |
|
|
hi,
I am searching for an easy way to copy possibly large amounts of files to a windows filesystem (NTFS or VFAT, possibly Samba-Shares); my problem is that the filenames (music) partly contain characters that are not allowed for windows filesystems, like *\.
Is there an _easy_ way, suitable for copying lots of files at once? The workaround I found so far is copying the files temporarily somewhere else on a linux partition and then use e.g. krename to remove the bad characters, but that is quite annoying … doing this directly with konqueror or amarok would be wonderful. _________________ "You may say I'm a dreamer, but I'm not the only one."
Last edited by supermihi on Fri Feb 22, 2008 2:50 pm; edited 1 time in total |
|
Back to top |
|
|
pathfinder l33t
Joined: 19 Jan 2006 Posts: 731 Location: Barcelona, Spain
|
Posted: Fri Feb 22, 2008 12:42 pm Post subject: |
|
|
well, i would do a tarball
then use p7zip for windows to untar it. |
|
Back to top |
|
|
massimo Veteran
Joined: 22 Jun 2003 Posts: 1226
|
Posted: Fri Feb 22, 2008 12:42 pm Post subject: |
|
|
Put these files in an archive and move the archive to that windows share and unpack the archive and see if the tool can handle the files or (for this you need to emerge rename):
Code: |
find music_folder -iname "*" -exec renamexm 's/\:|\*|\?|\"//g' "{}" \;
|
_________________ Hello 911? How are you? |
|
Back to top |
|
|
supermihi Guru
Joined: 09 Feb 2005 Posts: 348
|
Posted: Fri Feb 22, 2008 2:49 pm Post subject: |
|
|
Thanks for the hint, tarring the files and then unpacking them with 7zip does what I want: It replaces the characters by underbars. _________________ "You may say I'm a dreamer, but I'm not the only one." |
|
Back to top |
|
|
pathfinder l33t
Joined: 19 Jan 2006 Posts: 731 Location: Barcelona, Spain
|
Posted: Fri Feb 22, 2008 2:58 pm Post subject: |
|
|
and you could also apply sed to the file names:
sed 's/whatyoudontwant/bywhatyouwanttosubstitute/g'
oups. I mean, you should be able to write a script in sed telling the computer to get all files in a directory and replacing their names by another char,
sed 's/_/YEAH/g' input_file > output_file
would create an output file from an input file replacing on all its lines the underscore by the YEAH word. |
|
Back to top |
|
|
massimo Veteran
Joined: 22 Jun 2003 Posts: 1226
|
Posted: Fri Feb 22, 2008 5:52 pm Post subject: |
|
|
pathfinder wrote: | and you could also apply sed to the file names:
sed 's/whatyoudontwant/bywhatyouwanttosubstitute/g'
oups. I mean, you should be able to write a script in sed telling the computer to get all files in a directory and replacing their names by another char,
sed 's/_/YEAH/g' input_file > output_file
would create an output file from an input file replacing on all its lines the underscore by the YEAH word. |
Well, then take a look at my previous post..... guess what find is doing. _________________ Hello 911? How are you? |
|
Back to top |
|
|
|