More file-renaming problems involving commas...

  • Thread starter
  • Start date

Just a bit of background to orient anybody who might not have seen previously postings:

I regularly get files from an external website (that I have no control over whatsoever) that have underscores in their names rather than blanks. Since I really hate underscores in my file names (strictly for cosmetic reasons, I will be the first to admit :eek:), I have been trying to write a batch file to rename these files to a format that is more pleasing (to my eyes)! (For too long a time, I might add!) The file names also may have both open and close parenthesis as well as commas (all of which I rather like!). There has been a sequence of interchanges with folks on this website on this matter in the past, all of which have resolved the matter to a given point. This is, I think, the last entry in the sequence, and I am reporting it here primarily because I think it's a bug. (It does have a not-too-bad workaround.) So, here goes. Starting with a (fairly?) simple batch file that shows the bug (I'm attaching it because it's a little lengthy), everything works correctly other than the final conversion back to commas. (To make everything work in other processes, I start out by changing commas in the file names to pound signs ("#"), and when I'm all done I want to change the pound signs back to commas.) The "bug" (if that's what it is) can be stated rather simply: If I use the "@replace" function directly to change these pound signs back to commas, everything works correctly, but if I "wrap" the "@replace" function in an otherwise user-defined function that also has functions that do the other conversions I want in it, it fails miserably (the output is not at all what I would expect/hope for!). Since the @replace works fine when it is called directly and fails (miserably?) when it is embedded in a user-written function, I tend, again, to think this is a (weird?) bug. (The work-around is to call the @replace function directly rather than wrapping it in a function with invocations of other functions in it.) Just in case somebody's interested!


  • Demo.bat
    1.1 KB · Views: 84
Similar threads
Thread starter Title Forum Replies Date
R Reading an Unicode file with more than 8191 lines Support 1
Charles Dye More help nits Support 0
L detach /Q is more yappy than advertised Support 3
vefatica WAD More SET /A woes Support 4
D TCC has much more elegant ways for usebackq. What ways? Support 12
vefatica Make FFIND a bit more friendly? Support 14
vefatica More on the help Support 12
nikbackm WAD More Windows 10 woes Support 8
fromano How to? Everything finding directories with 2 or more files in them Support 3
vefatica WAD More on ACTIVATE Support 4
vefatica More on IFTP Support 7
mfarah More on pdir's options: /(fq) Support 5
Dan Glynhampton Documentation v15 help: More mailto: links Support 2
Dan Glynhampton Documentation v15 help: More odd mailto: links in the help Support 8
C Looking for files with more than 1 period Support 2
vefatica More on the installer Support 5
J DebugMonitor - More mystical than magnets? Support 6
D "Learn More" button on home page not working Support 3
J Colors in tcmd (one more try) Support 1
M More SafeChars type issues... Support 4
Y More v13 weirdness Support 4
S More HELP nits Support 5
vefatica WINDOW (and more closing TCC woes) Support 15
Jay Sage More on Problem with Tabbed Toolbar Support 0
Roedy stops working Support 1
dcantor More date-related help items for V11 Support 0
Jay Sage More Problems with TCTOOLBAR Support 0
vefatica @IPNAME (and more) Support 2
J History file load hangs if file has complete garbage in it... Support 1
jdanielp Cannot step into and/or call another .bat file when debugging .bat file Support 2
thorntonpg file explorer - short cut keys Support 1
JohnQSmith New online help file wrong logo Support 7
Jay Sage WAD Possible Bug With OPTION Command With @FILE Support 5
samintz How to? swap endianness in a binary file Support 12
vefatica `Back quotes` - command line vs. batch file Support 5
fpefpe How to? batch file size Support 2
Jay Sage Issues With TCMD File Explorer Support 0
FreezerBurnt Help making a CMD and TCC compatible batch file Support 7
Joe Caverly @FILESIZE and NTFS File Stream Support 1
Joe Caverly Embedding an .EXE (or other file) into a .BTM Support 8
U Command help on file names Support 5
S Concatenate all playlists into 1 file Support 22
Joe Caverly Set a batch variable (%1 - %n) when TCC is executing a batch file Support 5
Joe Caverly Rename file that begins with Emoji Support 7
Joe Caverly PSHELL and NTFS File Streams Support 2
P Kill all other instances of tcc from a btm batch file Support 2
D ffind hangs on large file Support 18
Alpengreis Documentation Minor issue in help file for view /E Support 1
fpefpe batch file ending early Support 18
J Licesne file location Support 1

Similar threads