Importing ASCII data (OpenInsight 32-bit Specific)
At 17 NOV 2003 12:26:08PM James Jenka wrote:
My return to the Revelation community is a little rougher than expected as might be evident by my recent cries for help.
I am trying to import (lots of) ASCII data to a empty existing OI tables with column definitions already in place. I would like to specify that one of my tab delimited ASCII columns is to become the key to the OI row. I can't seem to get around a sequential key being assigned to the imported rows after trying many variations on OI ASCII import. The number of tables and number of rows in each table is too overwhelming to import to a temporary tables then port to the actual OI tables.
At 17 NOV 2003 12:26PM Richard Bright wrote:
Err.. why not knock up your own. Lay out a standard OSRead etc and Loop / write to file. Set up equates for the Dict and the just swap in the correct equates.
At 17 NOV 2003 12:26PM James Jenka wrote:
Just to clarify - I do NOT want OI to assign a sequential key. There is NOT a sequential key indicated for the key column in the dictionary.
Unable to use Excel - well over 1,000,000 rows in some tables.
I may give the import on ARev a try. All my tables are set for use by both ARev and OI - I assume that I just need to attach the directory from AREv and proceed. I may have better luck.
THANKS FOR ALL THE SUGGESTIONS.
At 17 NOV 2003 12:26PM Don Miller - C3 Inc. wrote:
Jimmy me boyo ..
You're much better off rolling your own import in that case. It's not a difficult task except for data conversions needed for AREV/OI internal formats. If your DICT's are right, you can get the conversion from there .. assuming there's only 1 ICONV for a given field (which is usually true). Otherwise, it's pretty straightforward using OSBREAD into a buffer, find the CR/LF, etc. You'll have to unparse the CDA data if there are imbedded comma's. What I've found in the past is that the AREV ASCII import generally works pretty well and since you have the source code available you can tweak it if you need. Give it a different name and run it from the TCL.
Don M.
At 17 NOV 2003 12:26PM [email protected] wrote:
If you have Arev around you could use it .. it was a little easier if I remember right ..
At 17 NOV 2003 12:26PM Oystein Reigem wrote:
James,
I've done many imports, although it's been a while. But I can't remember a problem with sequential keys.
With Database Manager's "Import ASCII" window you can import data from e.g delimited text files, with e.g one line per row (Delimiters Row=13,10). At the bottom of the window you specify the target for each of your delimited fields, starting with the key, continuing with field 1, 2, etc.
So each line (or whatever) in your text file must contain
etcAfter checking old import specs and old text files I believe this is the way I did it no matter what kind of key I had - sequential or not. I always had the key values included in the imported data.
If there is a problem with the import adding its own sequential keys perhaps your target table has got sequential keys. Then turn off the sequential key while you import. You can always turn it on again afterwards.
You say you want one of your delimited columns to become the key. I really do believe this column must be the first value in your delimited data. If it's not, paste your data into Excel and shuffle the columns until you get the same order as you want to have in your target table - key first, and all the fields in correct order afterwards.
- Oystein -
At 17 NOV 2003 12:26PM [email protected] wrote:
if you don't have Arev around (or it wont do the job) Oystein hit the nail on the head. we use excel a lot to move columns around, add seq keys etc .. works very well. Plus gives you a change to bulk edit data etc.
At 17 NOV 2003 12:26PM Oystein Reigem wrote:
(Somehow the last paragraph of my posting got lost)
Then copy the data from Excel back to a text file, and try to import anew.
- Oystein -
At 17 NOV 2003 12:26PM Oystein Reigem wrote:
James,
Just to clarify - I do NOT want OI to assign a sequential key. There is NOT a sequential key indicated for the key column in the dictionary.
Don't know how much that clarified. It's a mystery where your unwanted sequential keys came from.
![]()
But if your key and fields are in the wrong order anyway there's no point in discussing ASCII Import further.
- Oystein -
At 17 NOV 2003 12:26PM James Jenka wrote:
As suggested … I "rolled my own." I was able to include some application specific items and complete in less than one hour. Thanks for reminding me that writing some code is usually the easiest solution.