<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <tt>Well I heard my name being mentioned so I thought I better chime
      in.  <br>
      <br>
      Since you are loading what looks to be a CSV file with 4 fields
      per record, I expect you just need to get the 4 fields and then
      using the second number you locate the job and ddd the charges. 
      Since this requires a lookup, the associated field logic does not
      work.<br>
      <br>
      Associated fields did not work in a lookup() so you would have to
      use an array to map to the fields in the destination file and loop
      through those.<br>
      <br>
      The associated fields do work in your current record and it is
      useful for data entry situations like you might do, where instead
      of the user finding a blank line, they would type into dummy
      variables and programming could easily locate a blank row to put
      the data in.<br>
      <br>
      Or when you want to find all the charges for $5.00 and you have 20
      rows per record.  If the fields are associated, you can search
      them with something like A1 eq "5.00" and it will return @af which
      will indicate the correct row in your 20 items.<br>
      <br>
      I know this post is not timely and I apologize but I was out for a
      few week after the conference.<br>
      <br>
      Nancy<br>
      <br>
    </tt>
    <div class="moz-cite-prefix">On 11/1/2019 10:50 AM, scooter6--- via
      Filepro-list wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CADpQzqOLGqFE8RkYuzWnjjvM=j0nKXC78viJCthYAgusq-G02g@mail.gmail.com">
      <pre class="moz-quote-pre" wrap="">I think my problem will be that the charges aren't necessarily in order
So, I could get:

Charges|327|Paint|100.00
Charges|455|Carpet|150.00
Charges|455|Plumbing|300.00
Charges|327|Electric|75.00

So, it would lookup the first line using 327 as the key, look at that
record which could have 2 charges in it already - and this one now needs to
be added as charge 3
Then it will lookup the second line using 455 as the key (so it's on a
different record now) and that one may not have any charges on it yet, so
this one needs to added as charge 1...and so on

So if that's the case, will loading an associated fields array work when it
chooses the specific record and 'count' (or can code make it count) how
many fields are empty?  That's where my confusion sets in - I've never
done @AF and doing F10 in processing and search for @AF there isn't an
example shown there
Guess I'll take a look at the online manual

work in progress....

thanks all


On Thu, Oct 31, 2019 at 6:17 PM James Flanagan <a class="moz-txt-link-rfc2396E" href="mailto:James@flantec.com"><James@flantec.com></a> wrote:

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">Are the 40 fields defined as an array?  If so, (assuming that they are
defined as fields 61-100)


Dim chg(40)^61

ct=“1”
loop::’:
:chg(ct) ne “”:ct=ct+”1”;goto loop:
::chg(ct)=(imported data)

Make sense?


James Flanagan
Flantec.com

email: <a class="moz-txt-link-abbreviated" href="mailto:James@Flantec.com">James@Flantec.com</a>
mobile: 760-458-8498
home:  219-221-6219
text: <a class="moz-txt-link-abbreviated" href="mailto:7604588498@txt.att.net">7604588498@txt.att.net</a>

Skype: Flantec
ichat: <a class="moz-txt-link-abbreviated" href="mailto:James@Flantec.com">James@Flantec.com</a>

home: 1901 Cidermill Road
Michigan City, IN 46360


On Oct 31, 2019, at 4:59 PM, <a class="moz-txt-link-abbreviated" href="mailto:scooter6@gmail.com">scooter6@gmail.com</a> wrote:

Sample.csv

Charges|327|Paint|2019-10-25|100.00
Charges|327|Carpet|2019-10-23|650.00
Charges|526|Bathtub|2019-10-21|175.00

Each line that starts with 'Charges|' will lookup record based on 2nd field

When it finds that record, that record can have 40 different fields to put
the details of these charges

I want to know simplest way to find the first of those 40 different fields
that is blank and put the charges detail in that and then goto loop

Hope that helps clarify

I'll look at the @AF and ^A that you have in your import statement

On Thu, Oct 31, 2019 at 5:29 PM James Flanagan <a class="moz-txt-link-rfc2396E" href="mailto:James@flantec.com"><James@flantec.com></a> wrote:

</pre>
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap="">Scott,

If I understand what you are tying to do, I have done just that.
Conditionally, set variables based upon what the line content is.


Sample csv file

labor,80.00
equipment,140.00
other,20.00


Import

loop::’:
file=“tmp/file.csv"
::import ascii pck=(file) r=\n f=^A:
:not pck:goto ender:
:pck(1) co “labor”:lb=pck(2);goto loop:
:pck(1) co “equip”:eq=pck(2);goto loop:
:pck(1) co “other”:ot=pck(2);goto loop:

Please let me know if I may have misunderstood what you are trying to
do.  Thank you.


James Flanagan
Flantec.com <a class="moz-txt-link-rfc2396E" href="http://flantec.com/"><http://flantec.com/></a>

email: <a class="moz-txt-link-abbreviated" href="mailto:James@Flantec.com">James@Flantec.com</a>
mobile: 760-458-8498
home:  219-221-6219
text: <a class="moz-txt-link-abbreviated" href="mailto:7604588498@txt.att.net">7604588498@txt.att.net</a>

Skype: Flantec
ichat: <a class="moz-txt-link-abbreviated" href="mailto:James@Flantec.com">James@Flantec.com</a>

home: 1901 Cidermill Road
Michigan City, IN 46360

<PastedGraphic-1.tiff>

On Oct 31, 2019, at 3:35 PM, scooter6--- via Filepro-list <
<a class="moz-txt-link-abbreviated" href="mailto:filepro-list@lists.celestial.com">filepro-list@lists.celestial.com</a>> wrote:

I will have ongoing csv files that I need to import into a filePro
database

The beginning of each line is static, in that it will say one of 4-5
things
- based on field 1, it goes to a different part of the import
There is one that will start with   'Charges|'   (it's a pipe delimited
file)
The 2nd field is used to look up the record

Each record in filePro can have up to 40 charges in it

Since the inbound csv file won't necessarily be sorted in order of field 2
(the key to lookup the record) - is there a simpler way to know which
field
to put the new charge in vs having to say

if charge field 1 is not "" but charge field 2 is blank, then put this
charge in field 2 and so on?
The bottom line will be if all 40 charge fields are not empty, it will
skip
the record (which I have that part - ) just wondering if there's an easier
way I'm not thinking of than to 'step' through each charge field until I
find the first empty one....

thanks
Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <
<a class="moz-txt-link-freetext" href="http://mailman.celestial.com/pipermail/filepro-list/attachments/20191031/b137ff56/attachment.html">http://mailman.celestial.com/pipermail/filepro-list/attachments/20191031/b137ff56/attachment.html</a>
</pre>
          <blockquote type="cite">
            <pre class="moz-quote-pre" wrap="">
</pre>
          </blockquote>
          <pre class="moz-quote-pre" wrap="">_______________________________________________
Filepro-list mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a>
Subscribe/Unsubscribe/Subscription Changes
<a class="moz-txt-link-freetext" href="http://mailman.celestial.com/mailman/listinfo/filepro-list">http://mailman.celestial.com/mailman/listinfo/filepro-list</a>



</pre>
        </blockquote>
        <pre class="moz-quote-pre" wrap="">
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">-------------- next part --------------
An HTML attachment was scrubbed...
URL: <a class="moz-txt-link-rfc2396E" href="http://mailman.celestial.com/pipermail/filepro-list/attachments/20191101/85dc74b3/attachment.html"><http://mailman.celestial.com/pipermail/filepro-list/attachments/20191101/85dc74b3/attachment.html></a>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-1.tiff
Type: image/tiff
Size: 19328 bytes
Desc: not available
URL: <a class="moz-txt-link-rfc2396E" href="http://mailman.celestial.com/pipermail/filepro-list/attachments/20191101/85dc74b3/attachment.tiff"><http://mailman.celestial.com/pipermail/filepro-list/attachments/20191101/85dc74b3/attachment.tiff></a>
_______________________________________________
Filepro-list mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a>
Subscribe/Unsubscribe/Subscription Changes
<a class="moz-txt-link-freetext" href="http://mailman.celestial.com/mailman/listinfo/filepro-list">http://mailman.celestial.com/mailman/listinfo/filepro-list</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Nancy Palmquist         MOS & filePro Training Available
Virtual Software Systems    Web Based Training and Consulting   
PHONE: (412) 835-9417           Web site:  <a class="moz-txt-link-freetext" href="http://www.vss3.com">http://www.vss3.com</a> 
</pre>
  </body>
</html>