Aussie John Posted November 13, 2002 Posted November 13, 2002 someone gave me a DB that had a list of furniture items. Trouble is they are all in one field and separated by "returns". Any nifty ways to separate them into separate records? so can bring them back in as a portal. thanks
kennedy Posted November 13, 2002 Posted November 13, 2002 Loop Exit Loop If [ IsEmpty(gList) ] New Record / Request SetField [ ItemName, Left(gList, Position(gList, "P", 1, 1)-1) ] # any other field settings in the new furniture item record SetField [ gList, Right(gList, Length(gList) - Position(gList, "P", 1, 1)) ] End Loop where "P" is the paragraph symbol in quotes.
CobaltSky Posted November 13, 2002 Posted November 13, 2002 The principle behind the solution Brian has suggested will work fine if you have a single set of entries in a global field. If, as I suspect may be the case, you have a group of entries in a text field on each record, then you are going to need a slightly more complex solution which passes through all the records, expanding each in turn, until all the values from all the records have been separated. The principle is essentially that of expanding data arrays, since the text you are dealing with is actually an array (albeit separated by a carriage return rather than the various other delimiters sometimes used). I suggest that to do this, you might be interested to take a look at an 'Array Expander' example file which I've posted to my web site. The URL to download it from is: http://www.nightwing.com.au/FileMaker/demos/ArrayExpander.zip It is a free unlocked demo, which illustrates a scripting approach to the expansion of arrays. The example in the file uses numeric data which is pipe delimited, but exactly the same principle can be used to 'expand' text arrays which are 'CR delimited', so you will readily be able to adapt it to your purposes if you wish.
Recommended Posts
This topic is 8116 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