Any instructions? how to create a list of files including quotation marks?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
jackhawkins
New Member
New Member
Posts: 1
Joined: 2023-09-07, 03:13 UTC

Any instructions? how to create a list of files including quotation marks?

Post by *jackhawkins »

"Hello, could you please provide instructions on how to create a list of files in Total Commander (TC) that includes quotation marks around each file, as shown in the example below:
""Text.txt""
""Folder""
Your assistance is greatly appreciated."
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6969
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Any instructions? how to create a list of files including quotation marks?

Post by *Horst.Epp »

That's not a format which can be created native by TC.

One possible solution is:
Select your dirs and files
Use a button with the command cm_CopyFullNamesToClip.

Start your editor
Paste the clipboard content
Use a RegEx to add the quotation marks around all lines.

In PSPad editor for example
Search for
^(.*)$
Replace by
""$1""
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.55 RC1 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
User avatar
white
Power Member
Power Member
Posts: 5785
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Any instructions? how to create a list of files including quotation marks?

Post by *white »

jackhawkins wrote: 2023-10-10, 10:00 UTC Hello, could you please provide instructions on how to create a list of files in Total Commander (TC) that includes quotation marks around each file, as shown in the example below:
""Text.txt""
""Folder""
* Mark the files/folders.
* Open the Multi-Rename Tool.
* Set options as in this screenshot and choose "Edit names" as shown in the screenshot.
* Save the file to a name and location of your choice.

BTW, it's a bit weird to add double double quote characters. If you meant single double quote characters then replace the double double quote characters with single double quote characters ;)
User avatar
Gral
Power Member
Power Member
Posts: 1600
Joined: 2005-01-26, 15:12 UTC

Re: Any instructions? how to create a list of files including quotation marks?

Post by *Gral »

Another way - download and install MakeBAT plugin - https://plugins.ghisler.com/plugins/makebat.zip
You can assign it for TXT extension or default - BAT and change manually on "Pack files" dialog window.
Select files in source panel and use "Pack" command under "Files" menu (Alt+F5) (you actually don't pack files, only doing some manipulation with it's names)
When dialog window "Batch files creator" appear type ""%N"" and press OK. Names will be packed to target directory.
Note: no support for files in subdirectory unless you use Branch View or search na %P%N parameters.
Although my experience tell me that maybe you need just single double quotes.

Also - it's rather clear that this is only part of your problem, so maybe explain the whole problem, not part of it?
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Any instructions? how to create a list of files including quotation marks?

Post by *Stefan2 »

Hello and welcome jackhawkins

jackhawkins wrote: 2023-10-10, 10:00 UTC "Hello, could you please provide instructions on how to create a list of files in Total Commander (TC) that includes quotation marks around each file, as shown in the example below:
""Text.txt""
""Folder""
Your assistance is greatly appreciated."


you could utilize PowerShell (or any other scripting language) from an TC-Button
in combination with TCs parameter '%F' to output the selected files surrounded by doubled double quotes:

Get-Content ' %F ' | Foreach-Object{ [char]34 + [char]34 + $_ + [char]34 + [char]34 }


- - -


-- create an button

Copy&Paste button code:

Code: Select all

TOTALCMD#BAR#DATA
PowerShell -NoExit
TYPE '%F' | Foreach{ [char]34 + [char]34 +  $_ + [char]34 + [char]34 }
powershell
Output selected files with doubled "double quotes" added


-1


-- select the wanted files

-- click at your new button

-- watch the output:

Example output with '%F' parameter
"d\""
"e\""
"LANGUAGE\""
"DEFAULT.BAR""
"descript.ion""
"HISTORY.TXT""
"TOTALCMD.CHM""
"TOTALCMD.INC""
"TOTALCMD.EXE.MANIFEST""
"TOTALCMD.EXE""
"TOTALCMD64.EXE""



Example output with '%L' parameter
""C:\Temp\tc1100x32_64_rc1_(2023-07-12)\INSTALL\d\""
""C:\Temp\tc1100x32_64_rc1_(2023-07-12)\INSTALL\e\""
""C:\Temp\tc1100x32_64_rc1_(2023-07-12)\INSTALL\LANGUAGE\""
""C:\Temp\tc1100x32_64_rc1_(2023-07-12)\INSTALL\DEFAULT.BAR""
""C:\Temp\tc1100x32_64_rc1_(2023-07-12)\INSTALL\descript.ion""
""C:\Temp\tc1100x32_64_rc1_(2023-07-12)\INSTALL\HISTORY.TXT""
""C:\Temp\tc1100x32_64_rc1_(2023-07-12)\INSTALL\TOTALCMD.CHM""
""C:\Temp\tc1100x32_64_rc1_(2023-07-12)\INSTALL\TOTALCMD.INC""
""C:\Temp\tc1100x32_64_rc1_(2023-07-12)\INSTALL\TOTALCMD.EXE.MANIFEST""
""C:\Temp\tc1100x32_64_rc1_(2023-07-12)\INSTALL\TOTALCMD.EXE""
""C:\Temp\tc1100x32_64_rc1_(2023-07-12)\INSTALL\TOTALCMD64.EXE""




 
Fla$her
Power Member
Power Member
Posts: 2996
Joined: 2020-01-18, 04:03 UTC

Re: Any instructions? how to create a list of files including quotation marks?

Post by *Fla$her »

Win XP+:

Code: Select all

TOTALCMD#BAR#DATA
mshta.exe "javascript:with(new ActiveXObject('Scripting.FileSystemObject')){t=openTextFile(getSpecialFolder(2)+'\\'+
'%WF'.replace(/.+(?=CMD\w+\.tmp$)/,''),1,0,-1).readAll().replace(/\n(?!$)/g,'\n""').replace(/^|(?=\r)/g,'""').slice(0,-2);with(openTextFile(getAbsolutePathName('')+'\\FList.txt',2,1,-1)){write(t);close()}};close();"
wcmicon2.dll,46
Create a list of selected names in doubled quotation marks

1
or

Code: Select all

TOTALCMD#BAR#DATA
%ComSpec% /q/c move
%UF FList.txt&"%%COMMANDER_PATH%%\Utils\sed.exe" -i -r "s/^|$/""""""/g" FList.txt
wcmicon2.dll,46
Create a list of selected names in doubled quotation marks

1
In the second button, specify your path to sed.exe.
Overquoting is evil! 👎
Post Reply