May 22, 201213 yr Hello, I need to process a string on over 6000+ records and will eventually become an automated routine, basically I need to clean a string which will be implemented in web publishing and I would like to know if there is a way with just 1 step to read a string and replace all the alphanumeric values (meaning a value that contains both numbers and letters) in uppercase. I already have a custom function that cleans the string based on the on the symbols I don't need. These would be a few examples of what I need to do: Original: Ultra2 SCSI Cable New: ULTRA2 SCSI Cable Original: CMOS Battery (7.2V, 15Mah) New: CMOS Battery (7.2V, 15MAH) Original: 68 To 50pin SCSI Adapter New: 68 To 50PIN SCSI Adapter Original: 146.8gb SCSI Hard Drive New: 146.8GB SCSI Hard Drive Thanks in advance for the help, if you need further information just let me know.
May 22, 201213 yr You will need either a custom function or a looping script to go over each word in the text. Having to keep the surrounding punctuation (e.g. parentheses) is an additional complication.
May 22, 201213 yr Substitute or Replace Function you will need to add other find and replace criteria you want to correct. see sample of a calculation or script in attached. Elkpodemiami.fmp12.zip
May 23, 201213 yr Author Thanks for the replies, Lee, I've seen the file but its pretty basic compared to what I'm trying to do, like I said, this is process that will require 6000+ lines to be cleaned up, with new text coming in, the whole purpose is to detect all the alphanumeric words in a string or sentence and make them uppercase, I don't know every single alphanumeric value in all those lines, I just input examples, but making a value list or just replacing / substituting specific words will be very limited to only those words instead of being an intelligent script and find every word that contains both letters and numbers and applying and upper style.
May 23, 201213 yr Author I have created a sample db that does what I need to do, I'm just using globals instead of variables but there are many ways to work with this data, the only problem is that It works based on a loop process, So what I'm trying to figure out is if there's any way to just simply replace contents in a field where the alphanumeric values are recognized and the upper function can be applied that way it's just 1 step, quicker / simpler / better. anyways here it goes Elkpodemiami.zip
May 23, 201213 yr I haven't installed version 12 yet, so I cannot see what you - or Lee - have done. Still, I don't know of a way to achieve what you have asked for without looping. On the bright side, it can probably be assumed that for the current purpose, "words" will always be separated by spaces, so you can start with substituting spaces by carriage returns, then looping on the resulting values - see the attached. UpperizeCF.fp7.zip
May 23, 201213 yr Author I saw your file and the custom function you applied does the job very well, I still can't figure out the function correctly, I mean, I see what its doing but I dont understand it completely. Thanks for helping me out =)
May 23, 201213 yr Author Ohhh ok, I studied it more carefully and basically what you do is to call the function again until the the total value reaches 1, so you make a loop into the function itself, pretty smart, works very well, thank you very much.
May 23, 201213 yr call the function again until the the total value reaches 1 No, not really. You process the first value, then call the function again with the remaining values, until you run out of values to process.
May 23, 201213 yr Author Gotcha, I missunderstood that part, I already applied it, in my case instead of creating a calculation field I just "replace contents" along with that custom function and did the job, I think that It's much efficient to use the replace contents with that custom function than a script with loop to go to every single record / word in the string Thanks a lot =)
May 23, 201213 yr Hi comment, You didn't miss anything from me, I just threw out a basic substitute calculation to see what kind of a response the original poster would make. when I saw his file then I knew where he was headed. I was going to post a grip Find / Replace for text Editor, but your file out did What I came up with. Incredible file, I wished I could think the way you do. Lee
Create an account or sign in to comment