Import question
scooter6 at gmail.com
scooter6 at gmail.com
Wed Mar 10 14:43:13 PST 2021
I'm actually doing something very similar to this currently - but because
my import reads in each line, then does a lookup to the database to store
all the data, I'm not able to alternate using xx then yy then xx etc
I'm storing each value in a variable and then writing the output to the
main database - meaning, when I'm done parsing all the fields it does a
free record lookup to the database and make Charge1 eq aa, Charge2 eq ab,
Charge3 eq ac....etc....to the current max I have of 40 charges - but I
will see if I can incorporate this style in the browse lookup database I'm
going to create
Thanks for your input
On Wed, Mar 10, 2021 at 5:27 PM Richard Kreiss <rkreiss at gccconsulting.net>
wrote:
> You can do this but it will take some programming.
>
> 1. Use dlen to get the actual length of the import. qq=dlen(ab) where ab
> is the value oif the field holding the 100 fields that need to be broken
> down.
> 2. strtok will return the location of the ^; the first iteration of the ^
> can be gotten by using xx=strtok(ab,"^") gives the location of the first ^
> 3. use Mid to extract the field information. Mid(ab,"1",xx)
> 4. move to yy=xx+"1"; xx=strtok(ab,"^",yy) should give you the next
> location of the "^" and repeat the mid statement using the new value of
> the location.
>
> The first time through you can set xx to "1", this will have strtok start
> its reading a the first value in the field. You must keep testing for xx
> ="0" as this will indicate that there are no more "fields" to read(find).
> You already know the actual size of the data by using dlan(ab).
>
>
>
>
>
>
> > -----Original Message-----
> > From: Filepro-list <filepro-list-bounces+rkreiss=
> verizon.net at lists.celestial.com>
> > On Behalf Of scooter6--- via Filepro-list
> > Sent: Wednesday, March 10, 2021 3:58 PM
> > To: filePro Mailing List <filepro-list at lists.celestial.com>
> > Subject: Import question
> >
> > So I have an import routine that imports a csv of some parsed XML It's
> pretty
> > detailed and I use a ton of variables My question is, let's suppose I
> have a field
> > that has over a 100 fields within it, separated by a ^
> >
> > For example, if I'm importing a huge list of amounts, the field I need to
> > breakdown can have 100 or more that are
> >
> > 100.00^21.20^50.00^62.50^33.12..........etc
> >
> > Is there an easier way than using strtok to parse large fields like this?
> >
> > I originally didn't think there would ever be more than 40, but some of
> my
> > brilliant clients who don't always know what they're doing in our
> integrated
> > partner's software, have sometimes managed to have 100 or more - so
> trying to
> > see if there is a better/simpler way to do this
> >
> > Otherwise, I'm going to spit it off into its own file and create a
> lookup screen on
> > the records - which I can do, but didn't really want to go that route if
> not
> > necessary
> >
> > I currently parse the incoming XML with xsltproc and create a csv file
> and that all
> > works well - I'm trying to come up with possibly a better way to get
> that into my
> > fp databases
> >
> > thanks for any input
> >
> > Scott
> > PDM
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > URL: <http://mailman.celestial.com/pipermail/filepro-
> > list/attachments/20210310/7355e9f7/attachment.html>
> > _______________________________________________
> > Filepro-list mailing list
> > Filepro-list at lists.celestial.com
> > Subscribe/Unsubscribe/Subscription Changes
> > http://mailman.celestial.com/mailman/listinfo/filepro-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20210310/87aae404/attachment.html>
More information about the Filepro-list
mailing list