import question

Nancy Palmquist nancy.palmquist at vss3.com
Wed Nov 13 12:33:36 PST 2019


Well I heard my name being mentioned so I thought I better chime in.

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.

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.

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.

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.

I know this post is not timely and I apologize but I was out for a few 
week after the conference.

Nancy

On 11/1/2019 10:50 AM, scooter6--- via Filepro-list wrote:
> 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 <James at flantec.com> wrote:
>
>> 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: James at Flantec.com
>> mobile: 760-458-8498
>> home:  219-221-6219
>> text: 7604588498 at txt.att.net
>>
>> Skype: Flantec
>> ichat: James at Flantec.com
>>
>> home: 1901 Cidermill Road
>> Michigan City, IN 46360
>>
>>
>> On Oct 31, 2019, at 4:59 PM, scooter6 at gmail.com 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 <James at flantec.com> wrote:
>>
>>> 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 <http://flantec.com/>
>>>
>>> email: James at Flantec.com
>>> mobile: 760-458-8498
>>> home:  219-221-6219
>>> text: 7604588498 at txt.att.net
>>>
>>> Skype: Flantec
>>> ichat: James at Flantec.com
>>>
>>> home: 1901 Cidermill Road
>>> Michigan City, IN 46360
>>>
>>> <PastedGraphic-1.tiff>
>>>
>>> On Oct 31, 2019, at 3:35 PM, scooter6--- via Filepro-list <
>>> filepro-list at lists.celestial.com> 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: <
>>> http://mailman.celestial.com/pipermail/filepro-list/attachments/20191031/b137ff56/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/20191101/85dc74b3/attachment.html>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: PastedGraphic-1.tiff
> Type: image/tiff
> Size: 19328 bytes
> Desc: not available
> URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20191101/85dc74b3/attachment.tiff>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list

-- 
Nancy Palmquist         MOS & filePro Training Available
Virtual Software Systems    Web Based Training and Consulting
PHONE: (412) 835-9417           Web site:  http://www.vss3.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20191113/3436ff9e/attachment.html>


More information about the Filepro-list mailing list