Import from excel into a parent and child

  • Follow


Mac OS 9.2
FMP 5.5

EXCEL SAMPLE 1

            field 1         field 2         field 3         field 4
Record #1   province1       city 1          item 1          item 2
Record #2   --------        --------        item 1          item 2
Record #3   --------        --------        item 1          item 2
Record #4   --------        --------        item 1          item 2
Record #5   province2       city 2          item 1          item 2
Record #6   --------        --------        item 1          item 2
Record #6   province3       city 3          item 1          item 2
Record #7   --------        --------        item 1          item 2
Record #8   --------        --------        item 1          item 2
                ETC.....

EXCEL SAMPLE 2

            field 1         field 2         field 3         field 4
Record #1   province1       --------        --------        --------
Record #2   --------        city 1          --------        --------
Record #3   --------        --------        item 1          item 2
Record #4   --------        --------        item 1          item 2
Record #5   --------        --------        item 1          item 2
Record #6   province2       --------        --------        --------
Record #7   --------        city 2          --------        --------
Record #8   --------        --------        item 1          item 2
Record #9   --------        --------        item 1          item 2
                ETC.....

I'm trying to get this excel exported text file into FMP A parent file
(field 1 & 2) and a child (field 3 & 4)

Should I use EXCEL SAMPLE 1 or 2

I plan to sort fields 3 & 4 within field 2, so that after sorting, the pair
of items associated with city 1 will still be associated with item 1 etc.

Thank-you

0
Reply TuneRaider2k 9/18/2003 10:20:50 PM

If you're keeping f1 and f2 in the same table, then I would go with
something more like:



field 1 field 2 field 3 field 4

Record #1 province1 city 1 -------- --------

Record #2 -------- -------- item 1 item 2

Record #3 -------- -------- item 1 item 2

Record #4 -------- -------- item 1 item 2

Record #5 province1 city 2 -------- --------

Record #6 -------- -------- item 1 item 2

Record #7 -------- -------- item 1 item 2

Record #8 province2 city 1 -------- --------

Record #9 -------- -------- item 1 item 2

Record #10 -------- -------- item 1 item 2



Then you can write a loop in FileMaker that will create related records
in the child table each time it encounters for the "item 1 item 2"
records, and will also delete the "item 1 item 2" record from the parent
table once its been created in the child table.



LOOP

---IF (isempty(f1) and isempty(f2))

-----create related record

-----delete record

---ELSE

-----store the ID of this record (which will remain in the parent table)

-----go to record/request (next, exit after last)

---END IF

END LOOP



Hope this helps!


--
Mariano Peterson


Posted via http://dbforums.com
0
Reply marianopeterson 9/19/2003 2:17:32 AM


What is the precise syntax of this loop function.
All my attempts generate errors.

Once this is established, what is the process for exporting f1, f2 of the
parent, and f3 f4 of the child DB

Thank-you



'items 1 & 2

in article 3388778.1063937852@dbforums.com, marianopeterson at
member38786@dbforums.com wrote on 18/09/2003 8:17pm:

> 
> If you're keeping f1 and f2 in the same table, then I would go with
> something more like:
> 
> 
> 
> field 1 field 2 field 3 field 4
> 
> Record #1 province1 city 1 -------- --------
> 
> Record #2 -------- -------- item 1 item 2
> 
> Record #3 -------- -------- item 1 item 2
> 
> Record #4 -------- -------- item 1 item 2
> 
> Record #5 province1 city 2 -------- --------
> 
> Record #6 -------- -------- item 1 item 2
> 
> Record #7 -------- -------- item 1 item 2
> 
> Record #8 province2 city 1 -------- --------
> 
> Record #9 -------- -------- item 1 item 2
> 
> Record #10 -------- -------- item 1 item 2
> 
> 
> 
> Then you can write a loop in FileMaker that will create related records
> in the child table each time it encounters for the "item 1 item 2"
> records, and will also delete the "item 1 item 2" record from the parent
> table once its been created in the child table.
> 
> 
> 
> LOOP
> 
> ---IF (isempty(f1) and isempty(f2))
> 
> -----create related record
> 
> -----delete record
> 
> ---ELSE
> 
> -----store the ID of this record (which will remain in the parent table)
> 
> -----go to record/request (next, exit after last)
> 
> ---END IF
> 
> END LOOP
> 
> 
> 
> Hope this helps!
> 
> 
> --
> Mariano Peterson
> 
> 
> Posted via http://dbforums.com

0
Reply BB 9/22/2003 6:32:05 PM

LOOP
IF (isempty(f1) and isempty(f2))
create related record
delete record
ELSE
store the ID of this record (which will remain in the parent table)
go to record/request (next, exit after last)
END IF
END LOOP

> What is the precise syntax of this loop function.
> All my attempts generate errors.
> 
> Once this is established, what is the process for exporting f1, f2 of the
> parent, and f3 f4 of the child DB
> 
> Thank-you
> 
> 
> 
> 'items 1 & 2
> 
> in article 3388778.1063937852@dbforums.com, marianopeterson at
> member38786@dbforums.com wrote on 18/09/2003 8:17pm:
> 
>> 
>> If you're keeping f1 and f2 in the same table, then I would go with
>> something more like:
>> 
>> 
>> 
>> field 1 field 2 field 3 field 4
>> 
>> Record #1 province1 city 1 -------- --------
>> 
>> Record #2 -------- -------- item 1 item 2
>> 
>> Record #3 -------- -------- item 1 item 2
>> 
>> Record #4 -------- -------- item 1 item 2
>> 
>> Record #5 province1 city 2 -------- --------
>> 
>> Record #6 -------- -------- item 1 item 2
>> 
>> Record #7 -------- -------- item 1 item 2
>> 
>> Record #8 province2 city 1 -------- --------
>> 
>> Record #9 -------- -------- item 1 item 2
>> 
>> Record #10 -------- -------- item 1 item 2
>> 
>> 
>> 
>> Then you can write a loop in FileMaker that will create related records
>> in the child table each time it encounters for the "item 1 item 2"
>> records, and will also delete the "item 1 item 2" record from the parent
>> table once its been created in the child table.
>> 
>> 
>> 
>> LOOP
>> 
>> ---IF (isempty(f1) and isempty(f2))
>> 
>> -----create related record
>> 
>> -----delete record
>> 
>> ---ELSE
>> 
>> -----store the ID of this record (which will remain in the parent table)
>> 
>> -----go to record/request (next, exit after last)
>> 
>> ---END IF
>> 
>> END LOOP
>> 
>> 
>> 
>> Hope this helps!
>> 
>> 
>> --
>> Mariano Peterson
>> 
>> 
>> Posted via http://dbforums.com
> 

0
Reply TuneRaider2k3 9/22/2003 6:40:53 PM

in article 3388778.1063937852@dbforums.com, marianopeterson at
member38786@dbforums.com wrote on 18/09/2003 8:17pm:

Would it be possible to get an actual example of the loop script that is
outlined at the bottom of this missive?

Ie.;

Where mentioned below on the 3rd line of the loop script
> -----create related record
I think I am to summon the script step
Go to Related Record [Show,"xFare_test child"]
How do I load the value into it?

Where mentioned below on the 4th line
> -----delete record
How do I tell FMP5.5 to delete the related record of the Parent file?

The best book I could find at the library is still too vague & cryptic for
me?

All my co-workers are screaming for this 'thing' to become online.
I so hope that y'all can help me out.


> 
> If you're keeping f1 and f2 in the same table, then I would go with
> something more like:
> 
> 
> 
> field 1 field 2 field 3 field 4
> 
> Record #1 province1 city 1 -------- --------
> 
> Record #2 -------- -------- item 1 item 2
> 
> Record #3 -------- -------- item 1 item 2
> 
> Record #4 -------- -------- item 1 item 2
> 
> Record #5 province1 city 2 -------- --------
> 
> Record #6 -------- -------- item 1 item 2
> 
> Record #7 -------- -------- item 1 item 2
> 
> Record #8 province2 city 1 -------- --------
> 
> Record #9 -------- -------- item 1 item 2
> 
> Record #10 -------- -------- item 1 item 2
> 
> 
> 
> Then you can write a loop in FileMaker that will create related records
> in the child table each time it encounters for the "item 1 item 2"
> records, and will also delete the "item 1 item 2" record from the parent
> table once its been created in the child table.
> 
> 
> 
> LOOP
> 
> ---IF (isempty(f1) and isempty(f2))
> 
> -----create related record
> 
> -----delete record
> 
> ---ELSE
> 
> -----store the ID of this record (which will remain in the parent table)
> 
> -----go to record/request (next, exit after last)
> 
> ---END IF
> 
> END LOOP
> 
> 
> 
> Hope this helps!
> 
> 
> --
> Mariano Peterson
> 
> 
> Posted via http://dbforums.com

This reply to address will work once '_nospam' is deleted

0
Reply TuneRaider 9/30/2003 5:30:54 PM

My apologies for having offended you folks. I guess that my days of enjoying
this once awesome resource are gone. I figure that I must have ticked you
off by requesting a more concise example of what I currently have which
seems to assume that I know the syntax of most of the FMP stepping scripts,
(yes, I've seen the manual, to me, it reads too much like some MicroSoft
manual). Or perhaps it was my sincere yet maybe sarcastic sounding message
of gratitude directed at Bridget Eley. What ever, enough with the self
analysis, I need to get this 'effort' up and running. Once established, this
FMP step will hack hours off of my graphic production time. To sum up, more
family time.

Kudos to you all for your selfless support!


in article BB9F19E9.9A98%tuneraider2k5_nospam@yahoo.ca, TuneRaider at
tuneraider2k5_nospam@yahoo.ca wrote on 30/09/2003 11:30am:

> in article 3388778.1063937852@dbforums.com, marianopeterson at
> member38786@dbforums.com wrote on 18/09/2003 8:17pm:
> 
> Would it be possible to get an actual example of the loop script that is
> outlined at the bottom of this missive?
> 
> Ie.;
> 
> Where mentioned below on the 3rd line of the loop script
>> -----create related record
> I think I am to summon the script step
> Go to Related Record [Show,"xFare_test child"]
> How do I load the value into it?
> 
> Where mentioned below on the 4th line
>> -----delete record
> How do I tell FMP5.5 to delete the related record of the Parent file?
> 
> The best book I could find at the library is still too vague & cryptic for
> me?
> 
> All my co-workers are screaming for this 'thing' to become online.
> I so hope that y'all can help me out.
> 
> 
>> 
>> If you're keeping f1 and f2 in the same table, then I would go with
>> something more like:
>> 
>> 
>> 
>> field 1 field 2 field 3 field 4
>> 
>> Record #1 province1 city 1 -------- --------
>> 
>> Record #2 -------- -------- item 1 item 2
>> 
>> Record #3 -------- -------- item 1 item 2
>> 
>> Record #4 -------- -------- item 1 item 2
>> 
>> Record #5 province1 city 2 -------- --------
>> 
>> Record #6 -------- -------- item 1 item 2
>> 
>> Record #7 -------- -------- item 1 item 2
>> 
>> Record #8 province2 city 1 -------- --------
>> 
>> Record #9 -------- -------- item 1 item 2
>> 
>> Record #10 -------- -------- item 1 item 2
>> 
>> 
>> 
>> Then you can write a loop in FileMaker that will create related records
>> in the child table each time it encounters for the "item 1 item 2"
>> records, and will also delete the "item 1 item 2" record from the parent
>> table once its been created in the child table.
>> 
>> 
>> 
>> LOOP
>> 
>> ---IF (isempty(f1) and isempty(f2))
>> 
>> -----create related record
>> 
>> -----delete record
>> 
>> ---ELSE
>> 
>> -----store the ID of this record (which will remain in the parent table)
>> 
>> -----go to record/request (next, exit after last)
>> 
>> ---END IF
>> 
>> END LOOP
>> 
>> 
>> 
>> Hope this helps!
>> 
>> 
>> --
>> Mariano Peterson
>> 
>> 
>> Posted via http://dbforums.com
> 
> This reply to address will work once '_nospam' is deleted
> 

0
Reply TuneRaider2k 10/1/2003 3:29:44 PM

You should repost a new issue specifically asking about each step in the
pseudo-code you don't understand.  This post is old (sorts to the bottom of
the list on many usenet readers) and many people won't see it.

Sorry, don't have the time to explain the code at the moment but I'll try to
later.  Anyway, try posting new (more specific) topics.  I bet you'll get
many more answers.  You can also try other lists like www.dbforums.com,
http://www.maclane.com/cgi-bin/ultimatebb.cgi?ubb=get_daily, and
www.fmforums.com.


0
Reply Mariano 10/1/2003 4:28:53 PM

6 Replies
191 Views

(page loaded in 0.067 seconds)

Similiar Articles:













7/28/2012 8:16:44 PM


Reply: