Insert directory listing into file

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

rhmelis
Posts: 5
Joined: Fri Dec 04, 2009 8:01 am

Insert directory listing into file

Postby rhmelis » Wed Apr 07, 2010 11:40 pm

Hello,

Can Textpipe (or another Datamystic program) replace a string with a listing of the files in the current "read" directory?

For example: a directory holds the files test.txt, 1.txt and 2.txt.
Tetxpipe should then replace a string within 'test.txt' with:
test.txt
1.txt
2.txt

I hope you understand what i mean. Is this possible?

Thanks!
Remco

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

Re: Insert directory listing into file

Postby DataMystic Support » Thu Apr 08, 2010 3:31 pm

Sure Remco,

You can use the Scripting filter to do anything - like listing file contents.

Also see script filter\replace filename with file contents.fll
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

rhmelis
Posts: 5
Joined: Fri Dec 04, 2009 8:01 am

Re: Insert directory listing into file

Postby rhmelis » Thu Apr 08, 2010 4:57 pm

Hello Simon,

Thanks for the swift response. Now that I know it's possible, i'll figure it out!

Cheers,
Remco

rhmelis
Posts: 5
Joined: Fri Dec 04, 2009 8:01 am

Re: Insert directory listing into file

Postby rhmelis » Fri Apr 09, 2010 6:26 am

Hello Simon,

I lied.

I have no idea how to make this work. If I am correct, the script you pointed out changes the filename according the the filecontents??
I would like to replace a string within the file with a listing of the files in the same directory.

Could you give me another hint?

Thanks a lot :)

Remco

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

Re: Insert directory listing into file

Postby DataMystic Support » Fri Apr 09, 2010 9:41 am

Use the FileSystemObject in the example I gave you to generate a file list. You will need to lookup documentation on its
FindFirst/FindNext functions with google.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

rhmelis
Posts: 5
Joined: Fri Dec 04, 2009 8:01 am

Re: Insert directory listing into file

Postby rhmelis » Fri Apr 09, 2010 3:11 pm

Thanks for your help, but this scripting is beyond me. I'll try something else.

Tnhx,
Remco


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 1 guest