Storm Cellar Posted June 3, 2005 Posted June 3, 2005 Hi. Does anyone know how to sort text within a field? Thanks!
Lee Smith Posted June 3, 2005 Posted June 3, 2005 Hi Storm, If I'm understanding you correctly, you can Not sort the data within the filed like you can the fields. However, maybe your problem can still be solved by providing a lot more information, and a sample of your files and and other data that is pertinent to your problem. Just a WAG, but I'm betting that this is data that was imported and you are trying to organize it into fields, etc.. HTH Lee
David Kachel Posted June 3, 2005 Posted June 3, 2005 You can build a sorting routine into a Set Field script step. This is tedious, but doable. If as Lee suspected, you are importing data that needs to be organized, there may be a better approach. As a general rule, data in a single field that needs to be sorted indicates you should take a fresh look at your DB design.
-Queue- Posted June 3, 2005 Posted June 3, 2005 If the data in the field is return-delimited, then this is relatively easy and requires no script. See attached for sample. Note that when creating a new record, you must commit it before entering data into the field. If it is not return-delimited data, you can probably do the same thing with a couple of tweaks. SortFieldData.zip
Lee Smith Posted June 3, 2005 Posted June 3, 2005 Hi JT, Sweet! I knew someone would jump at the chance to prove my carefully worded response inaccurate, and I figured it would be you, Ugo or comment. LOL I had thought about a Value List approach, but my brain is still stuck in v6, and I haven't spent enough time (too busy with a client) play with the new stuff. I can see some value for this approach. Lee
-Queue- Posted June 3, 2005 Posted June 3, 2005 Hi, Lee! I think Ugo is busy and I'm just lucky I beat comment to the punch.
comment Posted June 5, 2005 Posted June 5, 2005 I haven't got into this because I don't know what "sort text within a field" means. If we are after sorting paragraphs, then my punch would have been different anyway (see 'Scripted sort' in attached). And I believe yours can be simplifed as shown. Still, there's a problem with a new record. And both methods remove duplicates, which may be desired - or not. SortDataInField.fp7.zip
-Queue- Posted June 7, 2005 Posted June 7, 2005 Good point on the dupes. Here's a version that should work with up to 100 words (FM7 indexes up to 100 characters per 'word', doesn't it?), doesn't remove duplicates, and doesn't require committing the record initially. Yes, it is scripted; I could not get it to work quickly enough without using a script. SortFieldDatav2.zip
comment Posted June 8, 2005 Posted June 8, 2005 Nice. I still don't know what it might be good for, but that "Repeat() function" is way cool! Consider it stolen.
-Queue- Posted June 8, 2005 Posted June 8, 2005 I think I 'borrowed' that one from Ray, or at least some version of it anyway. It comes in quite handy sometimes.
Recommended Posts
This topic is 7176 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