Pat Posted January 6, 2005 Posted January 6, 2005 Here's my pickle of a situation: I need to generate a set of data (e.g. a set of prescriptions for students to practice counseling) and I want to export the set to another file, then go back and generate another set for the next student. (I want to be able to use all data for random selection, and don't have enough data to just eliminate that which has already been chosen.) I would like to append the next export to the file the first export went into, rather than creating 200 files (I have 200 students in class!). How do I do that? I have no problem selecting the data, etc. I just am not sure how to export data and append it to the same file, if that is possible. Any help is appreciated--I'm trying to get this done for spring quarter! Thanks!
transpower Posted January 6, 2005 Posted January 6, 2005 Why create files? Create records, instead, one record per student, with a field for each prescription. You can create these records by script, using a random number generator to determine each prescription from a given list.
Pat Posted January 6, 2005 Author Posted January 6, 2005 I'm not sure I understand your suggestion. How do I go from marked records and transform them into fields on one record in another file? The file I'm working from is one that creates different prescriptions from a multitude of different variables. I should say the user creates the prescriptions from the file information, not that they are created by the file itself. So, for example, there might be 750 different prescriptions created in the file. Each student is to get a random selection of 30. I mark the first set of 30. How do I turn that into thirty fields to be exported as one record? Thanks for responding!
-Queue- Posted January 10, 2005 Posted January 10, 2005 Import into your secondary file instead of trying to Export from your primary one.
spiritquest Posted March 15, 2005 Posted March 15, 2005 Although importing would resolve this, Its not a great solution if you have to run a script on the primary file to get the data. I need a solution to concatenate / append data to an export file. My current setup: A script loops round writing grouped information into global fields. Once this loop is finished, I want to export that data into a FM / csv file. The script then runs through another cycle until its new set of data has been written, this now needs to be appended to the same target file. I have over 15,000 prodcucts in a databsae which the above script groups, based on various criteria. An automatic solution is desired, not requiring manual intervention to activate scripts or import hundreds of times. Any way of appending export data ? .. unfortunately the 'script generated' global fields can not be related to the target file, as there is no unique data anymore. The keyfield WAS the productID for the product. After the script has run anything from 2 - 100 products could be merged into one global field, thus killing its unique relational value. Any help here would be appreciated
spiritquest Posted March 15, 2005 Posted March 15, 2005 Although importing would resolve this, Its not a great solution if you have to run a script on the primary file to get the data. I need a solution to concatenate / append data to an export file. My current setup: A script loops round writing grouped information into global fields. Once this loop is finished, I want to export that data into a FM / csv file. The script then runs through another cycle until its new set of data has been written, this now needs to be appended to the same target file. I have over 15,000 prodcucts in a databsae which the above script groups, based on various criteria. An automatic solution is desired, not requiring manual intervention to activate scripts or import hundreds of times. Any way of appending export data ? .. unfortunately the 'script generated' global fields can not be related to the target file, as there is no unique data anymore. The keyfield WAS the productID for the product. After the script has run anything from 2 - 100 products could be merged into one global field, thus killing its unique relational value. Any help here would be appreciated
spiritquest Posted March 15, 2005 Posted March 15, 2005 Although importing would resolve this, Its not a great solution if you have to run a script on the primary file to get the data. I need a solution to concatenate / append data to an export file. My current setup: A script loops round writing grouped information into global fields. Once this loop is finished, I want to export that data into a FM / csv file. The script then runs through another cycle until its new set of data has been written, this now needs to be appended to the same target file. I have over 15,000 prodcucts in a databsae which the above script groups, based on various criteria. An automatic solution is desired, not requiring manual intervention to activate scripts or import hundreds of times. Any way of appending export data ? .. unfortunately the 'script generated' global fields can not be related to the target file, as there is no unique data anymore. The keyfield WAS the productID for the product. After the script has run anything from 2 - 100 products could be merged into one global field, thus killing its unique relational value. Any help here would be appreciated
sbg2 Posted March 16, 2005 Posted March 16, 2005 Are you exporting just the global fields as 1 record or multiple records that use the globals for data?
sbg2 Posted March 16, 2005 Posted March 16, 2005 Are you exporting just the global fields as 1 record or multiple records that use the globals for data?
sbg2 Posted March 16, 2005 Posted March 16, 2005 Are you exporting just the global fields as 1 record or multiple records that use the globals for data?
spiritquest Posted March 16, 2005 Posted March 16, 2005 I'm exporting the global fields as 1 record (ie 5 global fields generated by the script). All 5 need to be inside 1 record of the new desination file. The script will probably loop a few more times anywhere between 30+ to generate a new set of gloabl variables. Every time the script loops round a new set of globals is created and this new set wants to exported to a new record in the same destination file, the script exits after las record in the found set. Considering the source database contains 16,000+ records a found set could be anyhwere beween 70 and lets say 6,000.
spiritquest Posted March 16, 2005 Posted March 16, 2005 I'm exporting the global fields as 1 record (ie 5 global fields generated by the script). All 5 need to be inside 1 record of the new desination file. The script will probably loop a few more times anywhere between 30+ to generate a new set of gloabl variables. Every time the script loops round a new set of globals is created and this new set wants to exported to a new record in the same destination file, the script exits after las record in the found set. Considering the source database contains 16,000+ records a found set could be anyhwere beween 70 and lets say 6,000.
spiritquest Posted March 16, 2005 Posted March 16, 2005 I'm exporting the global fields as 1 record (ie 5 global fields generated by the script). All 5 need to be inside 1 record of the new desination file. The script will probably loop a few more times anywhere between 30+ to generate a new set of gloabl variables. Every time the script loops round a new set of globals is created and this new set wants to exported to a new record in the same destination file, the script exits after las record in the found set. Considering the source database contains 16,000+ records a found set could be anyhwere beween 70 and lets say 6,000.
sbg2 Posted March 16, 2005 Posted March 16, 2005 Make a new database with 5 text fields and write the globals from each loop to a new record. If you need a .csv file simply Show All Records & Export from the new file after the loop completes.
sbg2 Posted March 16, 2005 Posted March 16, 2005 Make a new database with 5 text fields and write the globals from each loop to a new record. If you need a .csv file simply Show All Records & Export from the new file after the loop completes.
sbg2 Posted March 16, 2005 Posted March 16, 2005 Make a new database with 5 text fields and write the globals from each loop to a new record. If you need a .csv file simply Show All Records & Export from the new file after the loop completes.
spiritquest Posted March 16, 2005 Posted March 16, 2005 thanks for your response. but i already have a new database with 5 text fields in them. I am trying to write to it, thats my big problem. HOW can i write the globals from my script into the new database ? As there is no relation link between them, there is no way of the script knowing where to write the data to .. .. I need to think about this a little more.
spiritquest Posted March 16, 2005 Posted March 16, 2005 thanks for your response. but i already have a new database with 5 text fields in them. I am trying to write to it, thats my big problem. HOW can i write the globals from my script into the new database ? As there is no relation link between them, there is no way of the script knowing where to write the data to .. .. I need to think about this a little more.
spiritquest Posted March 16, 2005 Posted March 16, 2005 thanks for your response. but i already have a new database with 5 text fields in them. I am trying to write to it, thats my big problem. HOW can i write the globals from my script into the new database ? As there is no relation link between them, there is no way of the script knowing where to write the data to .. .. I need to think about this a little more.
sbg2 Posted March 16, 2005 Posted March 16, 2005 Use the X relational operator to match all records from each table (not sure what version the X operator was added to FM).The attached file is for FM7 not sure what version you are using.
sbg2 Posted March 16, 2005 Posted March 16, 2005 Use the X relational operator to match all records from each table (not sure what version the X operator was added to FM).The attached file is for FM7 not sure what version you are using.
sbg2 Posted March 16, 2005 Posted March 16, 2005 Use the X relational operator to match all records from each table (not sure what version the X operator was added to FM).The attached file is for FM7 not sure what version you are using. 5textFields.zip
spiritquest Posted March 17, 2005 Posted March 17, 2005 Am using FMPro 6 (Have access to 7 but not really taken a look yet.) The solution I 've developed for a charity group is quite complex and time/funds aren't in place to migrate over to 7 yet. I use both platforms PC and Mac. I will see if I can take a look at your files later, any chance of a FMP6 version ? I'll look at the X relational operator online, see if I can get my head around it. Thanks for the feedback sbg2.
spiritquest Posted March 17, 2005 Posted March 17, 2005 Am using FMPro 6 (Have access to 7 but not really taken a look yet.) The solution I 've developed for a charity group is quite complex and time/funds aren't in place to migrate over to 7 yet. I use both platforms PC and Mac. I will see if I can take a look at your files later, any chance of a FMP6 version ? I'll look at the X relational operator online, see if I can get my head around it. Thanks for the feedback sbg2.
spiritquest Posted March 17, 2005 Posted March 17, 2005 Am using FMPro 6 (Have access to 7 but not really taken a look yet.) The solution I 've developed for a charity group is quite complex and time/funds aren't in place to migrate over to 7 yet. I use both platforms PC and Mac. I will see if I can take a look at your files later, any chance of a FMP6 version ? I'll look at the X relational operator online, see if I can get my head around it. Thanks for the feedback sbg2.
sbg2 Posted March 18, 2005 Posted March 18, 2005 Sorry, I do not have Version 6 only versions 4 and 7.
sbg2 Posted March 18, 2005 Posted March 18, 2005 Sorry, I do not have Version 6 only versions 4 and 7.
comment Posted March 18, 2005 Posted March 18, 2005 Queue already gave you the solution. Create your found set in the source file. From within the source file, call an external script in the target file. The called script IMPORTS the found set from the source file.
comment Posted March 18, 2005 Posted March 18, 2005 Queue already gave you the solution. Create your found set in the source file. From within the source file, call an external script in the target file. The called script IMPORTS the found set from the source file.
spiritquest Posted March 18, 2005 Posted March 18, 2005 Queue already gave you the solution. Create your found set in the source file. From within the source file, call an external script in the target file. The called script IMPORTS the found set from the source file. Comment, thanks. It's not always clear for me when viewing previous posts to simply understand a one line response, mainly because my mind is reeling form something I feel should be striaghtforward like appending or concatenating . To operate in reverse almost is strange. I'm still trying to get my head around Scriptmaker way of thinking. I had starting thinking about the external script idea just before I read your post it hit home when I read it. In my situation, its not as straightforward as importing the found set from my source file. I only need to import a single record(instance) from the source, even if the found set contains hundreds of records. So the solution still isn't foolproof. I got the import script (this is the script in the target file) working, and my workaround is thus: Creating a script in the target file which does the following: a) creates a new record perform find on a field that has a data field (which I set to NEW) for "NEW" this ensures you only ever get 1 record returned in the found set. c) Import the fields using the option "Replace Data in found set" d) delete the content of the NEW field It still brings up an error message when it imports as its trying to import the total value of found records in the source file, but at least it automates nearly all of the process barring this one error message, so if i can get round that then automation is on.
spiritquest Posted March 18, 2005 Posted March 18, 2005 Queue already gave you the solution. Create your found set in the source file. From within the source file, call an external script in the target file. The called script IMPORTS the found set from the source file. Comment, thanks. It's not always clear for me when viewing previous posts to simply understand a one line response, mainly because my mind is reeling form something I feel should be striaghtforward like appending or concatenating . To operate in reverse almost is strange. I'm still trying to get my head around Scriptmaker way of thinking. I had starting thinking about the external script idea just before I read your post it hit home when I read it. In my situation, its not as straightforward as importing the found set from my source file. I only need to import a single record(instance) from the source, even if the found set contains hundreds of records. So the solution still isn't foolproof. I got the import script (this is the script in the target file) working, and my workaround is thus: Creating a script in the target file which does the following: a) creates a new record perform find on a field that has a data field (which I set to NEW) for "NEW" this ensures you only ever get 1 record returned in the found set. c) Import the fields using the option "Replace Data in found set" d) delete the content of the NEW field It still brings up an error message when it imports as its trying to import the total value of found records in the source file, but at least it automates nearly all of the process barring this one error message, so if i can get round that then automation is on.
comment Posted March 18, 2005 Posted March 18, 2005 This one point is not clear: In your source file, do you not want to export the found set?
Recommended Posts
This topic is 7188 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now