Read from folder

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
Garren

Read from folder

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

Thanks,
Garren
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

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

Post 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
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Post by DataMystic Support »

Just use the Delete All filter - it is far quicker.
jring
Posts: 9
Joined: Tue Sep 23, 2003 3:13 am

Post by jring »

hmmm... If I'm understanding you correctly,
you could goto a dos prompt and type:

dir /B > filename.txt
Guest

Post by Guest »

jring - thanks that DOS command did work. I didn't know about that.
Thanks,
Garren
jring
Posts: 9
Joined: Tue Sep 23, 2003 3:13 am

I use that alot....

Post 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:

99_99_9999
99_99_9999

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!
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

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