import question

scooter6 at gmail.com scooter6 at gmail.com
Fri Nov 1 11:58:53 PDT 2019


I'm sure there is an easier way - but in interest of time - I wrote a loop
to go check with field was next empty one and assigned a count number
Then based on number returned am populating record accordingly
It works so....on to the next thing for now
I may revisit it later when I get more time
thanks to all who replied


On Fri, Nov 1, 2019 at 10:50 AM scooter6 at gmail.com <scooter6 at gmail.com>
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/7f75cca4/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/7f75cca4/attachment.tiff>


More information about the Filepro-list mailing list