<div dir="ltr">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<div>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</div><div>Thanks for your input</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 10, 2021 at 5:27 PM Richard Kreiss <<a href="mailto:rkreiss@gccconsulting.net">rkreiss@gccconsulting.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">You can do this but it will take some programming.<br>
<br>
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.<br>
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 ^ <br>
3. use Mid to extract the field information. Mid(ab,"1",xx)<br>
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.<br>
<br>
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).<br>
<br>
<br>
<br>
<br>
<br>
<br>
> -----Original Message-----<br>
> From: Filepro-list <filepro-list-bounces+rkreiss=<a href="mailto:verizon.net@lists.celestial.com" target="_blank">verizon.net@lists.celestial.com</a>><br>
> On Behalf Of scooter6--- via Filepro-list<br>
> Sent: Wednesday, March 10, 2021 3:58 PM<br>
> To: filePro Mailing List <<a href="mailto:filepro-list@lists.celestial.com" target="_blank">filepro-list@lists.celestial.com</a>><br>
> Subject: Import question<br>
> <br>
> So I have an import routine that imports a csv of some parsed XML It's pretty<br>
> detailed and I use a ton of variables My question is, let's suppose I have a field<br>
> that has over a 100 fields within it, separated by a ^<br>
> <br>
> For example, if I'm importing a huge list of amounts, the field I need to<br>
> breakdown can have 100 or more that are<br>
> <br>
> 100.00^21.20^50.00^62.50^33.12..........etc<br>
> <br>
> Is there an easier way than using strtok to parse large fields like this?<br>
> <br>
> I originally didn't think there would ever be more than 40, but some of my<br>
> brilliant clients who don't always know what they're doing in our integrated<br>
> partner's software, have sometimes managed to have 100 or more - so trying to<br>
> see if there is a better/simpler way to do this<br>
> <br>
> Otherwise, I'm going to spit it off into its own file and create a lookup screen on<br>
> the records - which I can do, but didn't really want to go that route if not<br>
> necessary<br>
> <br>
> I currently parse the incoming XML with xsltproc and create a csv file and that all<br>
> works well - I'm trying to come up with possibly a better way to get that into my<br>
> fp databases<br>
> <br>
> thanks for any input<br>
> <br>
> Scott<br>
> PDM<br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <<a href="http://mailman.celestial.com/pipermail/filepro-" rel="noreferrer" target="_blank">http://mailman.celestial.com/pipermail/filepro-</a><br>
> list/attachments/20210310/7355e9f7/attachment.html><br>
> _______________________________________________<br>
> Filepro-list mailing list<br>
> <a href="mailto:Filepro-list@lists.celestial.com" target="_blank">Filepro-list@lists.celestial.com</a><br>
> Subscribe/Unsubscribe/Subscription Changes<br>
> <a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" rel="noreferrer" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br>
</blockquote></div>