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.
Guest

File list export from Find Files & Directories

Post 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 ?
Jan Rysavy
ALTAP Staff
ALTAP Staff
Posts: 5229
Joined: 08 Dec 2005, 06:34
Location: Novy Bor, Czech Republic
Contact:

RE: File list export from Find Files & Directories

Post 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.
Attachments
find1.png
find1.png (52.46 KiB) Viewed 29878 times
User avatar
vld
Posts: 174
Joined: 06 Feb 2009, 21:21

Re: File list export from Find Files & Directories

Post 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?
User avatar
Ether
Posts: 1471
Joined: 10 May 2007, 16:08
Location: Czech Republic
Contact:

Re: File list export from Find Files & Directories

Post 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.
Ελληνικά rulez.
User avatar
vld
Posts: 174
Joined: 06 Feb 2009, 21:21

Re: File list export from Find Files & Directories

Post by vld »

EXCELLENT!!! :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 »

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.
Groente, Michel.
grep
Posts: 2
Joined: 07 Jan 2010, 12:08

Re: File list export from Find Files & Directories

Post 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"
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 »

For "clip", you need Windows Server 2003, Vista or 7. Or just copy their clip.exe to your XP C:\Windows\system32. :idea:
grep
Posts: 2
Joined: 07 Jan 2010, 12:08

Re: File list export from Find Files & Directories

Post 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!
User avatar
SvA
Posts: 483
Joined: 29 Mar 2006, 02:41
Location: DE

Re: File list export from Find Files & Directories

Post by SvA »

clip can be found here also (and probably in other Windows Resource Kits):
ftp://ftp.microsoft.com/Services/TechNe ... E/CLIP.EXE
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 »

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"
User avatar
SvA
Posts: 483
Joined: 29 Mar 2006, 02:41
Location: DE

Re: File list export from Find Files & Directories

Post 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.
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 »

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.
User avatar
Ether
Posts: 1471
Joined: 10 May 2007, 16:08
Location: Czech Republic
Contact:

Re: File list export from Find Files & Directories

Post 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.
Ελληνικά rulez.
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 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).
Post Reply