Apending Multiple Files In IDEA
Forums
Hi All
I have just imported 2000 files into IDEA. Is there an easier way to append all at one go? Is there possibility of writing a custom script? I am using IDEA 8.5.
Thank you in advance.
Regards
Aveen
Aveen, here is a script that
Aveen, here is a script that will do it, it is pretty much the same script as the import. The FOLDER shows the location of the imd files you want to append together. I would recommend having them in a directory one level under your working folder. This will read through all the files in that directory and append them together.
Option Explicit
Const FOLDER = "C:\Users\Brian\Documents\My IDEA Documents\IDEA Projects\Samples\aveen test\"
Const EXTENSION = "*.IMD"
Dim workingFolder As String
Sub Main
workingFolder =Client.WorkingDirectory()
Call importFiles()
client.refreshFileExplorer
End Sub
Function importFiles()
Dim Files As String
Dim filename As String
Dim dbName As String
Dim db As database
Dim task As task
Files = Dir(FOLDER & EXTENSION)
Dim bFirstPassInd As Boolean
bFirstPassInd = true
Set db = Client.OpenDatabase(FOLDER & Files)
Set task = db.AppendDatabase
Files = Dir
Do
' Get the next file name and place it in FileList.
If Len(Files) > 1 Then
task.AddDatabase FOLDER & Files
End If
Files = Dir
Loop While Files <> ""
dbName = client.uniquefilename("Append Databases")
task.PerformTask dbName, ""
Set task = Nothing
Set db = Nothing
Client.OpenDatabase(dbName)
Set db = Nothing
Set task = Nothing
End Function
There are a couple of reasons
There are a couple of reasons for that suggestion. This script performs an append of all the imd files located in that particular directory. If you left it at the top level so either at the project folder or working folder level the script would try and append every imd file, more than likely you will have files in there that are not of the same type. By placing all the files you wish to append one level lower you can isolate all the imd files that you wish to append together. One of the limitations of the append is that all the files have to be located in the project or working folder, as IDEA allows one level below that, that is usually the best option for this type of script.
Hope that makes sense.
Hi City1, sorry I originally
Hi City1, sorry I originally missed your comment. You can find the script here if you still need it: http://ideascripting.com/forum/append-multiple-files-same-folder
Hi Aveen, yes it is possible.
Hi Aveen, yes it is possible. I will try and put something together for you.