Import question

Richard Kreiss rkreiss at gccconsulting.net
Wed Mar 10 14:27:06 PST 2021


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 --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 14328 bytes
Desc: not available
URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20210310/48aa510b/attachment.bin>


More information about the Filepro-list mailing list