import into an array.

Kroboth, Joe joe_kroboth at chernay.com
Tue Nov 2 07:25:51 PDT 2010


> Here is some untested sample code.  Perhaps this will help.  Please
> remove the colons and supply the IF/Thens, as well as your appropriate
> import line where appropriate.
> 
> @once:::
> ::dim ary1(999); dim ary2(999):
> ::ct(6,.0) ' counter:
> loop:::
> ::import ascii fil = /tmp/file.txt [enter your import options here...]:
> ::not fil:goto done:
> ::ct=ct+"1":
> :ct gt "1000":msgbox "Too many Lines!"; exit:
> ::ary1(ct)=fil(1); ary2(ct)=fil(2) ' etc....:
> ::goto loop:
> done:::
> ::' at this point you have populated your arrays:
> ::exit:
> 
> Adjust your array limit as appropriate as well.  I believe the maximum
> is 32K.
> 
> Good Luck.
> Jeff Harrison
> Author of JHImport and JHExport.



The imports I'm doing have over a hundred fields. I was hoping to overlay the array and avoid the manual assignments ( aa=imp(1) ). I ended up taking Richard's suggestions and overlaid the dummy fields with an array. It still required manual assignments but was much easier to work with when processing the individual fields and ultimately coping the data to the correct lookup file. 

Thanks everyone.

Joe


More information about the Filepro-list mailing list