Creat File names from List

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

Posts: 3
Joined: Tue Oct 05, 2010 2:10 am

Creat File names from List

Postby japanese » Fri Oct 15, 2010 2:40 pm

Maybe this can be done and I haven't figured it out.

I have a list of say car models. I want to input each model individually into a specific file in a specific place and output each file with the model as the file name. ie if there are 100 models then there would be 100 files output, each with the specific file name inside a specific place in the file.

eg, target file content = This is a {input variable from list}

one model in the list is Corrolla.


File content = This is a Corolla.
File name = Corolla.htm

next model in the list is Landcruiser.


File content = This is a Landcruiser.
File name = Landcruiser.htm

I hope this makes sense. Can it be done? If not, it owuld be a usedful feature 9for me in any case!)


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

Re: Creat File names from List

Postby DataMystic Support » Mon Oct 18, 2010 7:52 am

Hi Tony,

You can easily do this by converting your filter to jscript or vbscript:

Code: Select all

'The global TextPipe Application object
dim vb_TextPipeApp
'The global TextPipe Filter Window
dim vb_TPWindow

  Set vb_TextPipeApp = CreateObject("TextPipe.Application")
  Set vb_TPWindow = vb_TextPipeApp.newWindow

..for loop for each car_name..

car_name = list[ index ]

dim f1,f2,f3,f4,f5,f6

TPWindow.logEnabled = false
TPWindow.logFilename = "textpipe.log"
TPWindow.logAppend = true
TPWindow.logThreshold = 500
TPWindow.inputMode = 1
TPWindow.inputBinaryFiles = 0
TPWindow.inputBinarySampleSize = 100
TPWindow.inputPromptOnEach = false
TPWindow.inputPromptOnReadOnly = false
TPWindow.inputDeleteFiles = false
TPWindow.inputInsideCompressed = true
f1 = TPWindow.addReplaceFilter( "{input variable from list}", car_name, 0, false, false, false, false, false, false, false, 0 )
TPWindow.outputMode = 2
TPWindow.outputMergeFile = "c:\car name.txt"

'File List:
TPWindow.addFile "c:\" _ car_name _ ".txt", 0, 1
if vb_TPWindow.execute = false then MsgBox "ERROR " & vbCrLF & vb_TPWindow.errorText

..end for loop


Simon Carter, - Insulin dose calculator for Type 1 diabetes - 250,000 free software downloads - send huge email attachments

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

Who is online

Users browsing this forum: Baidu [Spider], Yahoo [Bot] and 5 guests