If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
STUPID%20FILE%20NAMES
I saved a bunch of animated Gifs from a website. About 400 of them.
Rather than save them one by one, I just saved the entire webpage which had about 10 to 15 per page. Then I just went to the saved page, deleted the .htm file and the other junk, such as the scripts and headers. What remained were just the .GIF files. I thought this would save time, but I soon found out different. Instead of saving the file by it's name (EXample): ANIMATED GIFS DOG 01.GIF I got this: ANIMATED%20GIFS%20DOG%2001.GIF Why does it do this? It fills in all the blanks with %20, which seems really senseless and is annoying as hell. This is not the first time I've had this happen.... So, rather than save time, I now have 400 files to rename, one by one.... Just for the heck of it, I googled for "Bulk file remaner". I did download one program called "Bulk Rename Utility". I wasted an hour trying to understand the program, and deleted it. It makes no sense at all. That seems to be all that is available for this sort of use. All the time I wasted trying to understand that program, I could have manually renamed half the files. |
Ads |
#3
|
|||
|
|||
STUPID%20FILE%20NAMES
Spaces are not valid in URLs, so the space gets
replaced with the hex ANSI code for a space. (H20 or decimal 32) I'd suggest you look into VBScript and the Windows Script Host. I use it regularly for jobs like this and keep more than a dozen scripts on the Desktop. Here's a sample. If you copy the text below into Notepad and save it with .vbs extension, you can drop a folder onto it. The script will ask you what text to replace in file names, then it will ask you what to replace it with. (For instance, you can enter %20 in the first box and type a space in the second. To remove text, leave the second box blank.) The script will then process all files in all subfolders, down one level, plus all files in the dropped folder. (It can be made recursive, but this version is probably adequate for most uses.) If you're nervous about doing this, copy the parent folder first and process that. ' Watch out for wordwrap when you copy this. '---------- begin vbscript--------------- Dim FSO, Arg, oFol, oFol2, oFols, oFil, oFils, s1, sRep, sRepWith Set FSO = CreateObject("Scripting.FileSystemObject") Arg = WScript.Arguments(0) If Len(Arg) = 0 Then MsgBox "Drop a folder onto this script.", 64 DropIt End If sRep = InputBox("Enter text to replace in file names.", "File Renaming", "%20") If Len(sRep) = 0 Then DropIt sRepWith = InputBox("Enter replacement text.", "File Renaming", "") If Len(sRepWith) = 0 Then sRepWith = "" On Error Resume Next Set oFol = FSO.GetFolder(Arg) Set oFols = oFol.SubFolders For Each oFol2 in oFols Set oFils = oFol2.files For Each oFil in oFils s1 = oFil.name s1 = Replace(s1, sRep, sRepWith) oFil.name = s1 Next Set oFils = Nothing Next Set oFols = Nothing Set oFils = oFol.files For Each oFil in oFils s1 = oFil.name s1 = Replace(s1, sRep, sRepWith) oFil.name = s1 Next Set oFils = Nothing Set oFol = Nothing DropIt Sub DropIt() MsgBox "Done." Set FSO = Nothing WScript.Quit End Sub '------------ end vbscript ------------------------------ wrote in message ... |I saved a bunch of animated Gifs from a website. About 400 of them. | Rather than save them one by one, I just saved the entire webpage which | had about 10 to 15 per page. Then I just went to the saved page, | deleted the .htm file and the other junk, such as the scripts and | headers. What remained were just the .GIF files. | | I thought this would save time, but I soon found out different. Instead | of saving the file by it's name | | (EXample): | | ANIMATED GIFS DOG 01.GIF | | I got this: | | ANIMATED%20GIFS%20DOG%2001.GIF | | Why does it do this? It fills in all the blanks with %20, which seems | really senseless and is annoying as hell. | This is not the first time I've had this happen.... | | So, rather than save time, I now have 400 files to rename, one by | one.... | | Just for the heck of it, I googled for "Bulk file remaner". I did | download one program called "Bulk Rename Utility". I wasted an hour | trying to understand the program, and deleted it. It makes no sense at | all. That seems to be all that is available for this sort of use. | All the time I wasted trying to understand that program, I could have | manually renamed half the files. |
#4
|
|||
|
|||
STUPID%20FILE%20NAMES
wrote:
I saved a bunch of animated Gifs from a website. About 400 of them. Rather than save them one by one, I just saved the entire webpage which had about 10 to 15 per page. Then I just went to the saved page, deleted the .htm file and the other junk, such as the scripts and headers. What remained were just the .GIF files. I thought this would save time, but I soon found out different. Instead of saving the file by it's name (EXample): ANIMATED GIFS DOG 01.GIF I got this: ANIMATED%20GIFS%20DOG%2001.GIF Why does it do this? It fills in all the blanks with %20, which seems really senseless and is annoying as hell. This is not the first time I've had this happen.... So, rather than save time, I now have 400 files to rename, one by one.... Just for the heck of it, I googled for "Bulk file remaner". I did download one program called "Bulk Rename Utility". I wasted an hour trying to understand the program, and deleted it. It makes no sense at all. That seems to be all that is available for this sort of use. All the time I wasted trying to understand that program, I could have manually renamed half the files. http://en.wikipedia.org/wiki/File_URI_scheme "Characters such as the hash (#) or question mark (?) which are part of the filename should be "percent-encoded". " http://en.wikipedia.org/wiki/Percent-encoding If you were a programmer, there is a great site for comparing techniques. In this example, they practice removing %20. They're not doing file renaming though, which would mean adding a few more lines of code. http://rosettacode.org/wiki/URL_decoding Here, some people propose DOS-like scripts for the job. I suspect this code is removing one %20 at a time. http://www.computing.net/answers/pro...mes/13957.html I would do it in some other language. And the job would likely take me all day to get right :-) Maybe I'd crack my PERL book and do it there. I think I have ActiveState PERL on the box here somewhere... It's a freebie. It would probably take around ten lines, tops... if I could figure it out :-) Paul |
#5
|
|||
|
|||
STUPID%20FILE%20NAMES
On Wed, 11 Jun 2014 06:29:56 -0600, Ken Springer
wrote: On 6/11/14 3:34 AM, wrote: I saved a bunch of animated Gifs from a website. About 400 of them. Rather than save them one by one, I just saved the entire webpage which had about 10 to 15 per page. Then I just went to the saved page, deleted the .htm file and the other junk, such as the scripts and headers. What remained were just the .GIF files. I thought this would save time, but I soon found out different. Instead of saving the file by it's name (EXample): ANIMATED GIFS DOG 01.GIF I got this: ANIMATED%20GIFS%20DOG%2001.GIF Why does it do this? It fills in all the blanks with %20, which seems really senseless and is annoying as hell. This is not the first time I've had this happen.... The %20 is the hexadecimal representation of a space. For a web address, you cannot have spaces in a file name you want to link to so it either displays or automatically starts the download process. "One of the most common special characters is the space. You can't type a space in a URL directly. A space position in the character set is 20 hexadecimal. So you can use %20 in place a space when passing your request to the server. "http://www.example.com/new%20pricing.html "This URL actually retrieves a document named new pricing.html from the www.example.com" http://www.tutorialspoint.com/html/h...l_encoding.htm That's the best I can offer without knowing the URL you started from. snip Ok, that makes sense. If I had clicked "SAVE AS" for each file, it would have saved them with the actual spaces. So instead of doing all of that, now I have to rename them all. Either way, it's a pain, but I just rename a few at a time. I could just leave them too, but I hate names like that. |
#6
|
|||
|
|||
STUPID%20FILE%20NAMES
On Wed, 11 Jun 2014 08:57:21 -0400, Paul wrote:
Just for the heck of it, I googled for "Bulk file remaner". I did download one program called "Bulk Rename Utility". I wasted an hour trying to understand the program, and deleted it. It makes no sense at all. That seems to be all that is available for this sort of use. All the time I wasted trying to understand that program, I could have manually renamed half the files. http://en.wikipedia.org/wiki/File_URI_scheme "Characters such as the hash (#) or question mark (?) which are part of the filename should be "percent-encoded". " http://en.wikipedia.org/wiki/Percent-encoding If you were a programmer, there is a great site for comparing techniques. In this example, they practice removing %20. They're not doing file renaming though, which would mean adding a few more lines of code. http://rosettacode.org/wiki/URL_decoding Here, some people propose DOS-like scripts for the job. I suspect this code is removing one %20 at a time. http://www.computing.net/answers/pro...mes/13957.html I would do it in some other language. And the job would likely take me all day to get right :-) Maybe I'd crack my PERL book and do it there. I think I have ActiveState PERL on the box here somewhere... It's a freebie. It would probably take around ten lines, tops... if I could figure it out :-) Paul If it takes all day, I can manually rename them much faster. This is a one shot deal, so no sense getting all involved. But I will try that script from mayayana and see if I can do it. I have had to rename multiple files in the past, but never this many. But even if I did them all at once (manually) I could do it in 2 hours tops. I already did about 100 of them. But that script looks like a challenge. I'll already made a copy in case I screw up. I just winzipped the whole folder. |
#7
|
|||
|
|||
STUPID%20FILE%20NAMES
On Wed, 11 Jun 2014 10:13:45 -0400, wrote:
On Wed, 11 Jun 2014 09:04:08 -0400, wrote: Ok, that makes sense. If I had clicked "SAVE AS" for each file, it would have saved them with the actual spaces. So instead of doing all of that, now I have to rename them all. Either way, it's a pain, but I just rename a few at a time. I could just leave them too, but I hate names like that. There are decent file renamers out there. It is a real problem with MP3 files in the binary groups. I have not used the one I had for a while but I will look for it. It would handy to have a utility like this, but that one I tried seemed worthless. It might work, but I'd probably have to spend a week trying to figure it out. Just seeing the screen shot of it looked like extreme bloat, but it was a small download so I thought I'd try. Yeah, I recall when I had access to binary newsgroups, the file names were real bizarre at times for MP3s. |
#8
|
|||
|
|||
STUPID%20FILE%20NAMES
On 6/11/14 7:04 AM, wrote:
On Wed, 11 Jun 2014 06:29:56 -0600, Ken Springer wrote: On 6/11/14 3:34 AM, wrote: I saved a bunch of animated Gifs from a website. About 400 of them. Rather than save them one by one, I just saved the entire webpage which had about 10 to 15 per page. Then I just went to the saved page, deleted the .htm file and the other junk, such as the scripts and headers. What remained were just the .GIF files. I thought this would save time, but I soon found out different. Instead of saving the file by it's name (EXample): ANIMATED GIFS DOG 01.GIF I got this: ANIMATED%20GIFS%20DOG%2001.GIF Why does it do this? It fills in all the blanks with %20, which seems really senseless and is annoying as hell. This is not the first time I've had this happen.... The %20 is the hexadecimal representation of a space. For a web address, you cannot have spaces in a file name you want to link to so it either displays or automatically starts the download process. "One of the most common special characters is the space. You can't type a space in a URL directly. A space position in the character set is 20 hexadecimal. So you can use %20 in place a space when passing your request to the server. "http://www.example.com/new%20pricing.html "This URL actually retrieves a document named new pricing.html from the www.example.com" http://www.tutorialspoint.com/html/h...l_encoding.htm That's the best I can offer without knowing the URL you started from. snip Ok, that makes sense. If I had clicked "SAVE AS" for each file, it would have saved them with the actual spaces. So instead of doing all of that, now I have to rename them all. Either way, it's a pain, but I just rename a few at a time. I could just leave them too, but I hate names like that. Would it be quicker to delete all of them and then download again using Save As? -- Ken Mac OS X 10.8.5 Firefox 25.0 Thunderbird 24.3.0 "My brain is like lightning, a quick flash and it's gone!" |
#9
|
|||
|
|||
STUPID%20FILE%20NAMES
On 6/11/14 9:23 AM, Ken Springer wrote:
On 6/11/14 7:04 AM, wrote: On Wed, 11 Jun 2014 06:29:56 -0600, Ken Springer wrote: On 6/11/14 3:34 AM, wrote: I saved a bunch of animated Gifs from a website. About 400 of them. Rather than save them one by one, I just saved the entire webpage which had about 10 to 15 per page. Then I just went to the saved page, deleted the .htm file and the other junk, such as the scripts and headers. What remained were just the .GIF files. I thought this would save time, but I soon found out different. Instead of saving the file by it's name (EXample): ANIMATED GIFS DOG 01.GIF I got this: ANIMATED%20GIFS%20DOG%2001.GIF Why does it do this? It fills in all the blanks with %20, which seems really senseless and is annoying as hell. This is not the first time I've had this happen.... The %20 is the hexadecimal representation of a space. For a web address, you cannot have spaces in a file name you want to link to so it either displays or automatically starts the download process. "One of the most common special characters is the space. You can't type a space in a URL directly. A space position in the character set is 20 hexadecimal. So you can use %20 in place a space when passing your request to the server. "http://www.example.com/new%20pricing.html "This URL actually retrieves a document named new pricing.html from the www.example.com" http://www.tutorialspoint.com/html/h...l_encoding.htm That's the best I can offer without knowing the URL you started from. snip Ok, that makes sense. If I had clicked "SAVE AS" for each file, it would have saved them with the actual spaces. So instead of doing all of that, now I have to rename them all. Either way, it's a pain, but I just rename a few at a time. I could just leave them too, but I hate names like that. Would it be quicker to delete all of them and then download again using Save As? Hmmmmm, I wonder if you could use the Rename command and wildcards in the Command Prompt window and make it work? -- Ken Mac OS X 10.8.5 Firefox 25.0 Thunderbird 24.3.0 "My brain is like lightning, a quick flash and it's gone!" |
#10
|
|||
|
|||
STUPID%20FILE%20NAMES
|
#11
|
|||
|
|||
STUPID%20FILE%20NAMES
wrote:
I saved a bunch of animated Gifs from a website. About 400 of them. Rather than save them one by one, I just saved the entire webpage which had about 10 to 15 per page. Then I just went to the saved page, deleted the .htm file and the other junk, such as the scripts and headers. What remained were just the .GIF files. I thought this would save time, but I soon found out different. Instead of saving the file by it's name (EXample): ANIMATED GIFS DOG 01.GIF I got this: ANIMATED%20GIFS%20DOG%2001.GIF Why does it do this? It fills in all the blanks with %20, which seems really senseless and is annoying as hell. This is not the first time I've had this happen.... So, rather than save time, I now have 400 files to rename, one by one.... Just for the heck of it, I googled for "Bulk file remaner". I did download one program called "Bulk Rename Utility". I wasted an hour trying to understand the program, and deleted it. It makes no sense at all. That seems to be all that is available for this sort of use. All the time I wasted trying to understand that program, I could have manually renamed half the files. My favorite simple file renamer is called "Renamer", by den4b. The Lite version is free. I haven't tried the newer version(s), as I'm still using a very old version, but it just might work for you!. http://www.den4b.com/ |
#12
|
|||
|
|||
STUPID%20FILE%20NAMES
On Wed, 11 Jun 2014 09:23:00 -0600, Ken Springer
wrote: Would it be quicker to delete all of them and then download again using Save As? I thought about that, but not on dialup. I can manually rename them faster. |
#13
|
|||
|
|||
STUPID%20FILE%20NAMES
|
#14
|
|||
|
|||
STUPID%20FILE%20NAMES
In message , Ken Springer
writes: [] Hmmmmm, I wonder if you could use the Rename command and wildcards in the Command Prompt window and make it work? possibly in a for ... in ... structure? -- J. P. Gilliver. UMRA: 1960/1985 MB++G()AL-IS-Ch++(p)Ar@T+H+Sh0!:`)DNAf Try to learn something about everything and everything about something. -Thomas Henry Huxley, biologist (1825-1895) |
#15
|
|||
|
|||
STUPID%20FILE%20NAMES
On Wed, 11 Jun 2014 09:18:13 -0400, wrote: There are decent file renamers out there. It is a real problem with MP3 files in the binary groups. I have not used the one I had for a while but I will look for it. It would handy to have a utility like this, but that one I tried seemed worthless. It might work, but I'd probably have to spend a week trying to figure it out. Just seeing the screen shot of it looked like extreme bloat, but it was a small download so I thought I'd try. Yeah, I recall when I had access to binary newsgroups, the file names were real bizarre at times for MP3s. Believe or not, Irfanview has batch filename utilities. I had to rename hundreds of filenames for a clients web page I did for him. It would worth it to just check it out... it's a free program: http://www.irfanview.com/ -- Zilbandy |
|
Thread Tools | |
Display Modes | |
|
|