Page 2 of 2

Re: File list export from Find Files & Directories

Posted: 10 Feb 2016, 17:00
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:

Re: File list export from Find Files & Directories

Posted: 11 Feb 2016, 11:17
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...

Re: File list export from Find Files & Directories

Posted: 21 Mar 2016, 04:53
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

Re: File list export from Find Files & Directories

Posted: 21 Mar 2016, 11:51
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!

Re: File list export from Find Files & Directories

Posted: 08 Apr 2018, 21:13
by Georgd
Thank you :) IMHO the most convienient and powerful workaround for the missing feature.

FYI, related posts with different solutions are:

File list export from Find Files Directories

Posted: 02 Oct 2019, 19:23
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.

Re: File list export from Find Files & Directories

Posted: 11 Oct 2019, 18:39
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 10671 times
This may not work, if you are in a custom find dialog of a plugin file system (e.g. the registry).

Re: File list export from Find Files & Directories

Posted: 14 Oct 2019, 13:52
by AD7
For this and other small operations I starter use XYplorer:

- export founded items (as CSV, clipboard)

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