Importing data into existing DB? Importing existing DB?


#1

With Panorama 6, I used to be able to import a text file into a “staging” database, do my clean-up and data munging, and then import that staging database into my main database. With PanoramaX, I can’t see how to do either of these procedures.

Importing a text file creates a new database.

File -> Open with an existing database open does not give me the option to append.

Am I missing something?


#2

When you search the documentation in Panorama X Help for „import", you’ll find information about most of the import options — including the importtext statement.

Other Panorama 6 options are still there: See the documentation about the openfile statement.

Kurt


#3

Yeah, that’s not really what I had in mind. What I was hoping for was the functionality I used to have in Panorama 6, which did not require scripting to import text or another database.


#4

You were probably using the Text Import wizard, which does not exist yet in Panorama X.


#5

Maybe, but even the file-open dialogue box is different now … fewer options.


#6

Here is a short procedure that you can add to your staging database. When you run the procedure, it will allow you to select a text file that will be imported into the staging database, the same way the File>Open dialog did in Panorama 6.

local fileChoice
choosefiledialog fileChoice
if fileChoice = {} rtn endif
importtext binarytotext(fileload(fileChoice)),{ExistingData},{Replace}

If you want to append instead of replace, just change Replace to Append.


#7

Jim,

thanks for sharing this code, but it works for me without the binarytotext( function only.

local fileChoice
choosefiledialog fileChoice
if fileChoice = {} rtn endif
importtext fileload(fileChoice),{ExistingData},{Replace}

Kurt


#8

That worked, thanks. I also was able to use this as a template to import Scratch.pandb into Warrants.pandb, which is the next step in the process. Much appreciated.


#9

Oops, another question: The online documentation shows the use of quote marks. In each example above, braces are used instead of quote marks. Is this a distinction without a difference?


#10

That is the same as in previous Panorama versions. The Panorama Essentials PDF documentation of Panorama 6 describes it on Page 578. (Because of formatting issues I post a screenshot here.)


#11

Thank you very much for this.