Import Question
Jeff Harrison
jeffaharrison at yahoo.com
Tue Sep 22 09:39:22 PDT 2009
--- On Tue, 9/22/09, Kenneth Brody <kenbrody at spamcop.net> wrote:
> From: Kenneth Brody <kenbrody at spamcop.net>
> Subject: Re: Import Question
> To: "Brandt Eppler" <beppler300 at verizon.net>
> Cc: filepro-list at lists.celestial.com
> Date: Tuesday, September 22, 2009, 11:10 AM
> Brandt Eppler wrote:
> > Hi All,
> >
> > Can you use a variable when defining fields in an
> import?
> [...]
> > ::fc(2,.0)="1"
> 'Field Count:
> > loop::IMPORT ASCII ref=/tmp/stuff R=\n F=,:
> > :not ref:end:
> > ::nn(10,*)=ref(fc);fc=fc+"1":
> > ::fs(35,*)=ref(fc);fc=fc+"1":
> [...]
>
> There is currently no documented way of using a variable
> for the import
> field number.
>
As I understand it, from what he told me off list, he may have multiple "records" within a given line, and he wants to post them out as separate entities. Another way he can handle this would be to use the comma as a record separator (and I suppose the \n as the field separator - but I have not tested this). Then he can evaluate each field one at a time and fill in the dummy fields nn, fs, etc. Then post them out when he has a full "record"'s worth.
Other solutions come to mind as well including using the raw IO commands - Or also as I mentioned to him off list - importing the whole thing as is into a temp file, then running a posting routine from the temp file.
Jeff Harrison
jeffaharrison at yahoo.com
More information about the Filepro-list
mailing list