Page 1 of 1

extract filenames to textfile

Posted: Mon Jan 28, 2008 5:31 am
by tonycaso
Hello,

I'm trying to extract filenames to a txt file in bulk mode. I mean I have a folder with thousands of txt files and I want to extract filenames of all files to a txt archive.

What I've done is to select "restrict to filename" and in a subfilter I've used "extract matching lines" (using a common name present in all files), but it doesn't work for me (error: can't create filename)...

I also used as a subfilter "add left margin" so next to do is replace useless part of filename, but no success :oops:

So I need some help, thank you very much
(sorry for my English, it's not my native language)

thnx

Why do you need TextPipe to do this?

Posted: Mon Jan 28, 2008 7:15 pm
by dfhtextpipe
You simply can do this without using TextPipe!
The following Windows command (in a Command Prompt window) would suffice:

Code: Select all

dir/b >H:\filenames.txt
Note: I merely illustrated using drive H [say] to store the text file, so that it doesn't get included in the list. Use any convenient path instead of H:\

For your_name common to all files, simply use some wildcard matching in the filespec:

Code: Select all

dir/b your_name*.* >H:\filenames.txt
Adapt the filespec to suit whatever you are trying to match.

If you want to repeat this task again in the future, simply save the command line in a suitably named .CMD file.

Posted: Tue Jan 29, 2008 12:08 am
by tonycaso
oook, :lol: thank you very much four your help, really thanks

Posted: Tue Feb 05, 2008 8:10 pm
by DataMystic Support
This can also be done with TP if you need to remove certain filenames from the list. Try this (in sysadmin\generate file list.fll)

Code: Select all

|
|--Input from file(s)
|     [ ] Confirm before processing each file
|     [X] Confirm before processing read/only files
|     [ ] Delete input files after processing
|     Process binary files
|   
|--Remove all
|   
|--Add header [@fullInputFilename\013\010]
|   
+--Merge output to file c:\myfilelist.txt
    

Files List
----------