Page 1 of 1

Read from folder

Posted: Thu Mar 11, 2004 10:31 am
by Garren
I have to say I love TextPipe. I was able to succesfully do a conversion for my job and my boss is very happy. I now have another job to do...

Is it possible to create a text file and put a list of files that are in a folder in that text file with TextPipe? Along with the name of the file will be some other stuff like the path of the file and some other stuff from another file.


Posted: Fri Mar 12, 2004 7:50 am
by DataMystic Support
I'm unsure exactly what you are doing, but you can use the macro @fullInputFilename inside Add Header/footer/margin filters, and you can use a Scripting filter to open and write to files and to other arbitrary processing.

Posted: Fri Mar 12, 2004 8:58 am
by Garren
What I was wanting was a text file with the names of the files in a directory. So I came up with the following filter that seems to work. I just exclude the first 1000000 from the start of the file, and grab the filename and merge it into one text file.

Filter List
Filter options
| [X] Log to file
| [X] Append to logfile
| Log filename: C:\BP\textpipe\install\textpipe.log
| Threshold 500
|--Input from file(s)
| [ ] Confirm before processing each file
| [ ] Confirm before processing read/only files
| [ ] Delete input files after processing
| Process binary files
|--Exclude 1000000 lines from start of file
|--Add header [@inputFilename ]
+--Merge output to file C:\Documents and Settings\gwood\Desktop\mergefilename.txt

Posted: Fri Mar 12, 2004 9:52 am
by DataMystic Support
Just use the Delete All filter - it is far quicker.

Posted: Fri Mar 12, 2004 4:36 pm
by jring
hmmm... If I'm understanding you correctly,
you could goto a dos prompt and type:

dir /B > filename.txt

Posted: Sat Mar 13, 2004 2:19 am
by Guest
jring - thanks that DOS command did work. I didn't know about that.

I use that alot....

Posted: Fri Mar 26, 2004 7:05 pm
by jring
here's a little trick is a great way to organize files on a daily basis... ie. weblogs, email logs, stock information or anything where you may have lots of files spread out over time:

1. do the date > C:\date.txt trick to output the date into a .txt file.
2. Strip out extraneous info from the textfile until only the date Remains.
3. Change the slashes in '99\99\9999' so that it reads 99_99_9999.
4. Repeat the file twice so that it reads:


4. Restrict to top line & add a lft-margin "MD C:\whatever\path\you\want\ "
5. Restrick to second line and add a left margin:

"Xcopy C:\original\path\*.* C:\whatever\path\you\want /q

6. Output the result to batch file "C:\COOLBATCH.bat"

Now create another .bat file which you can setup on a timer that reads something like this:

date > C:\date.txt
C:\program files\tpprt\textpipe.exe /f=c:\process_date_file.fll /g /q
Call C:\Coolbatch.bat
Del Original_Files /q

if you let this run, all of your files will be 100% organized into nice neat folders on a daily basis without any extra work....ever!

Posted: Mon Mar 29, 2004 8:37 am
by DataMystic Support
You could also use a vbscript filter to add the date...but it's a neat trick of Joseph's all the same.