import
Richard D. Williams
richard at appgrp.net
Wed Jan 17 13:25:35 PST 2018
Top Post:
Scott,
Yes and no. I wish there was a function like in php where you could
just explode the string into an array, but alas, there is not.
What I do is test the imported field value for a "^".
If it does not contain the "^", well, you just do what you program
normally does.
If it does contain the "^", this is what I do.
dim specval(20)
n(3,.0)=""
z="abc1234^xyz6789^rdwtest"
if: z co "^" and z ne ""
then:
p(3,.0)=instr(z,"^");la=mid(z,"1",p-"1");n=n+"1";specval(n)=la;la="";mid(z,"1",p)="";z=""{z{""
if: not(z co "^") and z ne ""
then: n=n+"1";specval(n)=z;goto done
Now z eq "xyz6789^rdwtest".
if z eq "" or n eq "20", I stop. If not I just loop back and do it again.
Once I am done this I then can write the loop to read specval array into
what ever I want.
Hope this helps,
Richard D. Williams
On 1/15/2018 4:20 PM, scooter6--- via Filepro-list wrote:
> I have a pipe delimited file that I'm looking to import
> It does however contain 4-5 fields that have ^ in them which denotes there
> are multiple items of data in a single field....
> Is there a way to pull the specific field of an import and put it in an
> array to pair with the filed after it...
>
> For example, a field has abc1234^xyz6789 (so this field contains
> 2 pieces of information
> The very next field has filename.pdf^filename2.pdf (so this field
> also contains 2 pieces of information)
>
> My filePro file has fields called set1, set1-file, set2, set2-file,
> etc.....
> I want to be able to assign abc1234 to the field called set1 and
> filename.pdf to set1-file; and assign xyz6789 to set2 and filename2.pdf to
> set2-file
>
> Is there a way to pull a field into an array and declare a character (in
> this case, the ^ ) as a sepator for the array....or is there even a simpler
> way to do this without doing a bunch of mid statements, etc?
>
> thanks
>
> Scott
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20180115/03f78196/attachment.html>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
>
>
>
> ---
> This email has been checked for viruses by AVG.
> http://www.avg.com
>
>
More information about the Filepro-list
mailing list