Creat File names from List

Get help with installation and running here.

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

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

Creat File names from List

Post by japanese »

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.

output:

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

next model in the list is Landcruiser.

output:

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!)

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

Re: Creat File names from List

Post by DataMystic Support »

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.startFilters
TPWindow.clearAllFilters
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"
TPWindow.endFilters


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

..end for loop

Post Reply