File list export from Find Files & Directories

We welcome any suggestions for new features or improvements in Altap Salamander. Please post one suggestion per report.
User avatar
mdruiter
Posts: 262
Joined: 22 Feb 2006, 15:33
Location: Amsterdam, The Netherlands
Contact:

Re: File list export from Find Files & Directories

Post by mdruiter »

I have found this a very useful solution.
Note that copying long lists of files can take some seconds or even minutes, but it does work. Don't copy anything else to the clipboard while waiting: the clipboard will be overwritten anyway. :idea:
User avatar
mdruiter
Posts: 262
Joined: 22 Feb 2006, 15:33
Location: Amsterdam, The Netherlands
Contact:

Re: File list export from Find Files & Directories

Post by mdruiter »

If you also need the 'seconds' part of the file modification time (in Windows Vista or newer) you might want to use the forfiles command, like this:

Code: Select all

forfiles /p "$(FullPath)" /m "$(Name)" /c "cmd /c echo @fdate @ftime @fsize @path"
So in full:

Code: Select all

setlocal ENABLEDELAYEDEXPANSION&(if "!SA!"=="" set SA="%TEMP%\sa%RANDOM%")&forfiles /p "$(FullPath)." /m "$(Name)" /c "cmd /c echo @fdate @ftime[TAB]@fsize[TAB]@path"| findstr /r /v /c:"^$$" >>!SA!&clip <!SA!
This is without attributes however. I guess one could combine for and forfiles to get attributes and seconds...
Last edited by mdruiter on 16 Aug 2022, 13:23, edited 1 time in total.
training
Posts: 4
Joined: 11 Dec 2014, 20:13

Re: File list export from Find Files & Directories

Post by training »

Sorry... but after reading all the comments, I admit I am getting lost. I have tried what you are posting but it is not working, so I am sure I am not understanding it well.

Could you please summarize the list of steps required to export the whole list of results to an external file or the clipboard, including file size and date?

Thank you in advance! :D
User avatar
mdruiter
Posts: 262
Joined: 22 Feb 2006, 15:33
Location: Amsterdam, The Netherlands
Contact:

Re: File list export from Find Files & Directories

Post by mdruiter »

Sure, that is actually a great idea as it's not trivial...
  1. press F9
  2. choose Customize...
  3. click somewhere in the white Menu Contents area
  4. press Insert to add a new entry
  5. type Copy properties as its name and press Enter
  6. at Command, type setlocal
  7. at Arguments, paste this:

    Code: Select all

    ENABLEDELAYEDEXPANSION&(if "!SA!"=="" set SA="%TEMP%\sa%RANDOM%")&for %%A in ("$(FullName)") do echo %%~aA;%%~tA;%%~zA;%%~A>>!SA!&clip<!SA!
    
  8. leave Execute through shell (and Show item in User Menu bar) checked
  9. uncheck the Open shell window check box
  10. click OK
This User Menu entry copies the properties of the selected files/folders to the clipboard: attributes, date/time (without seconds), size (in bytes) and full filename. Use it by selecting some files/folders (in the Find list), pressing F9 and choosing Copy properties. Then paste the properties into Notepad or Excel or wherever you need it.

For very large selections it might take a few seconds or even minutes until everything is on the clipboard.

Some explanation: setlocal ENABLEDELAYEDEXPANSION is necessary for the !SA! variable to work. A random temporary filename is made up (in the first iteration only). Then for enables the %~ (enhanced variable substitution, try FOR /?), which is used to add the properties to the file. The complete file is then copied to the clipboard using the clip command. This whole procedure will be repeated for every selected file/folder, so in the end the clipboard contains all echoed lines.

This forum changes TAB characters into spaces so I separated the properties by semicolons (;) instead. To get TABs for easy pasting into Excel, just copy a TAB to the clipboard once (e.g. in Notepad) and paste it over every semicolon in the Arguments you just configured.

If you need the time to include seconds (but no attributes), paste this into Arguments instead (and change the ;s into TABs again):

Code: Select all

ENABLEDELAYEDEXPANSION&(if "!SA!"=="" set SA="%TEMP%\sa%RANDOM%")&forfiles /p "$(FullPath)." /m "$(Name)" /c "cmd /c echo @fdate @ftime;@fsize;@path"|findstr /r /v /c:"^$$">>!SA!&clip<!SA!
User avatar
Georgd
Posts: 101
Joined: 24 Jul 2006, 17:13

Re: File list export from Find Files & Directories

Post by Georgd »

Thank you :) IMHO the most convienient and powerful workaround for the missing feature.

FYI, related posts with different solutions are:
Using Salamander since v 1.52
skiydus
Posts: 1
Joined: 17 Sep 2019, 17:41
Location: Costa Rica
Contact:

File list export from Find Files Directories

Post by skiydus »

Hello there,

I use keyboard shortcut for copying file-path all the time. But this feature does not work in Find-files window CtrlF. I have to go to file Spacebar and then I can copy what I need to. It would be great to be able to do it right from the search dialog.

Thank you.
User avatar
SvA
Posts: 483
Joined: 29 Mar 2006, 02:41
Location: DE

Re: File list export from Find Files & Directories

Post by SvA »

Hi skidus,

you should have created a new thread, rather than hijacking this one ...
This thread is about Salamander's lack of an option to export a list of found files, and offers various solutions.

Back to your matter. What exactly does not work where exactly?
For me, the usual shortcuts to copy various parts of the file in focus to the clipboard work ok, and also, the entries are there in the Edit menu, as always.
AS_Find.png
AS_Find.png (17.21 KiB) Viewed 10344 times
This may not work, if you are in a custom find dialog of a plugin file system (e.g. the registry).
User avatar
AD7
Posts: 566
Joined: 28 Jan 2006, 16:21

Re: File list export from Find Files & Directories

Post by AD7 »

For this and other small operations I starter use XYplorer:

- export founded items (as CSV, clipboard)

Screen:
https://imgur.com/a/9JBVVBS
Post Reply