Page 1 of 1

Import question

Posted: Tue May 13, 2014 12:59 pm
by omni
Roger,

We import all sort of files from banks and other resources. Normally a flat file with fixed length, or one that is comma delimited..or has some sort of identifier.
This one is tab delimited with each line being a different length. There is no tab delimited in Alask that I can find, just the comma. The var length makes it difficult to use any memoread. There is no constant at the beginning of each line. There are quotes around each item.

Any thoughts on how to read this file record by record to import...or best method?

I am considering looking for the end of line (return) and build it manually line by line, but was wondering if there was something I do not know about.

Update: There is no return at the end of each line, although there are definite lines. Using an editor with hex showing has nothing at the end of each line. I may be doing something wrong..not sure.


Thanks

Fred
Omni

Re: Import question

Posted: Tue May 13, 2014 2:54 pm
by Cliff Wiernik
I have taken the dbexport programs, or the alternate one from the alaska website and modified to provide the delimiting character. We had a file that was not CRLF but only one of them and needed to be able to specify the delimiter. Worked fine.

Also, have used DC_Token() and modified it in the past to do something like this.

You may want to look at these items.

Cliff.

Re: Import question

Posted: Tue May 13, 2014 2:59 pm
by bwolfsohn
i think you can use dc_tokenarray() and specifiy the tab character as a delimiter.

Re: Import question

Posted: Wed May 14, 2014 4:33 am
by rdonnay
I use the dc_txtline function to read a line from the file and the dc_token array function to parse the items into an array