1 Reply Latest reply on Jul 24, 2014 6:44 AM by philmodjunk

    Splitting a string into 30 separate records



      Splitting a string into 30 separate records


           Sounds silly but I'm given data as a big string, I can readily parse it into separate fields but really the data should be split into up to 30 records, each with 5 fields, for the data to be useful. It's not consistent, some may have only one set of  5 data points (rare) but most have around three.

           Each record will need to be associated with a client record via a client_PK

           Data includes one date field, one text, the rest are simply number fields

           The solution is running on a FM13 server so ideally I would prefer it to run with out exporting then reimporting records (how I'm doing it now) speed is not that critical as it tends to be in batches of 30 to 40 records once a week.

           My current solution just dumps each set as CSV file then reimports them but it just feels inelegant 


        • 1. Re: Splitting a string into 30 separate records

               If you can parse the data in to fields, you should be able to parse them into more than one record.

               But you haven't told use how the string is formatted nor how you currently parse the data.

               Best guess is that a loop could set up your table of records by looping through the string of values, but you'll need to share a few more details before we can tell you how to do this.