Page 1 of 2

File list export from Find Files & Directories

Posted: 20 Aug 2008, 14:51
by Guest
Is it possible to export the file list found with the Find Files & Directories where you look for example : *.txt that contain "building" ?
As of now i have not yet found it but is it build in ?

RE: File list export from Find Files & Directories

Posted: 20 Aug 2008, 15:26
by Jan Rysavy
It is possible using User Menu. Define new command in Salamander Options > Configuration > User Menu.
Command: echo
Arguments: $(FullName) >>d:\my_list.txt
turn off the Open shell windows option.

Then select all items in the Find windows (Ctrl+A), open User Menu (F9) and choose your defined command. Please note that d:\my_list.txt file will be modified.

Re: File list export from Find Files & Directories

Posted: 21 Aug 2009, 21:48
by vld
I would like this file to appear on the users Desktop.

I have changed:
Arguments: $(FullName) >>d:\my_list.txt
to
Arguments: $(FullName) >>%USERPROFILE%\Desktop\my_list.txt
but it does not work. Any ideas?

Re: File list export from Find Files & Directories

Posted: 21 Aug 2009, 21:54
by Ether

Code: Select all

$(FullName)>> "$[USERPROFILE]\Desktop\my_list.txt"
That's what you want.

Using the arrow on the right to the textbox you can access a menu, where you can see the Environmental Variable item. Type the variable name into the brackets and you're good to go.

Re: File list export from Find Files & Directories

Posted: 21 Aug 2009, 22:11
by vld
EXCELLENT!!! :D

Re: File list export from Find Files & Directories

Posted: 14 Sep 2009, 13:49
by mdruiter
Indeed, great trick :!:
Except... I would like to add the file size and date/time too, and $(FileSize) and $(FileTime) are not supported in user menus.

Re: File list export from Find Files & Directories

Posted: 07 Jan 2010, 12:11
by grep
If you want to get the content directly into your clipboard you could use:

$(FullName)>> "$[TEMP]\sal_file_list.txt" && clip < "$[TEMP]\sal_file_list.txt"

The side effect is that the list is not cleaned, which can be fixed using another user command like:
del /q "$[TEMP]\sal_file_list.txt"

Re: File list export from Find Files & Directories

Posted: 07 Jan 2010, 13:25
by mdruiter
For "clip", you need Windows Server 2003, Vista or 7. Or just copy their clip.exe to your XP C:\Windows\system32. :idea:

Re: File list export from Find Files & Directories

Posted: 07 Jan 2010, 17:44
by grep
mdruiter wrote:For "clip", you need Windows Server 2003, Vista or 7. Or just copy their clip.exe to your XP C:\Windows\system32. :idea:
Good point!

Re: File list export from Find Files & Directories

Posted: 07 Jan 2010, 21:06
by SvA
clip can be found here also (and probably in other Windows Resource Kits):
ftp://ftp.microsoft.com/Services/TechNe ... E/CLIP.EXE

Re: File list export from Find Files & Directories

Posted: 01 Aug 2014, 13:44
by mdruiter
Ths problem with CLIP is, that every file will fill the clipboard again, so it will not work for multiple files. :(

I did find a way to include a file's date and size: :idea:

Code: Select all

cmd /c for %%%%A in ($(FullName)) do @echo %%%%~aA  %%%%~tA  %%%%~zA  %%%%~nxsA  %%%%~A>> "$[USERPROFILE]\FilesList %DATE:/=-% %TIME:~0,2%;%TIME:~3,2%.txt"

Re: File list export from Find Files & Directories

Posted: 01 Aug 2014, 20:29
by SvA
Your DATE and TIME in the Filelist*.txt output file kind of defeats the purpose of of the >> , which is supposed to add more text to the file created by the previous call. Use a simple, well defined filename instead.

That's why grep said
grep wrote:The side effect is that the list is not cleaned, which can be fixed using another user command like:
del /q "$[TEMP]\sal_file_list.txt"
Since the command is called independently for each selected file, there is no way around this other than AS providing the file list macros known from the archiver configuration dialog or something similar to that.

And you should probably use ("$(fullname)") in you for statement (note the added " which Salamander does not provide). Otherwise for will not find files with blanks in their name.

Re: File list export from Find Files & Directories

Posted: 02 Aug 2014, 23:10
by mdruiter
My filename does not include seconds, so it will be fine most of the time. Just remove that part if you do not like it.

But the more important (I think) is the technique to include the date/time and size (and attributes) of the files in the list.

Re: File list export from Find Files & Directories

Posted: 04 Aug 2014, 08:53
by Ether
mdruiter wrote:Ths problem with CLIP is, that every file will fill the clipboard again, so it will not work for multiple files.
I don't think there's a problem, at least not with the command grep was suggesting. The command reads the whole list into the clipboard on every invocation, so after the last file is echoed to the list, the clipboard will contain the whole list.

Re: File list export from Find Files & Directories

Posted: 04 Aug 2014, 11:02
by mdruiter
I didn't realize that, smart!

I settled for:

Code: Select all

setlocal ENABLEDELAYEDEXPANSION&(if "!SA!"=="" set SA="%TEMP%\sa%RANDOM%")&for %%A in ("$(FullName)") do echo %%~aA[TAB]%%~tA[TAB]%%~zA[TAB]%%~A>>!SA!&clip <!SA!
Note:
  • Put the setlocal at the Command, the rest are all Arguments (this saves a cmd /c and quadruple %s)
  • Replace each [TAB] with a real tab: just copy it in an editor and paste it into Arguments in the correct 3 positions
  • Make sure Execute through shell is enabled; Open shell window can be disabled (for speed)
I also tried $(ListOfSelectedFullNames) which is a nice feature, but it doesn't work for long lists of files (32771 characters max).