hartmut Posted December 4, 2007 Posted December 4, 2007 I have some records that have unwanted space in the field before the information. Is there a text calc to remove it on the left of the information? Thanks
_henry_ Posted December 4, 2007 Posted December 4, 2007 Hello Hartmut, You can try to use Trim (FieldText). See the FM Help about Trim. Hope this answer your question...
hartmut Posted December 4, 2007 Author Posted December 4, 2007 I tried but the field remains the same. if it says " Main Street " it has spaces before and after. The info in the field is always different length, I just don;'t know how to trim off the blank spaces before and after. Thanks Dave
Raybaudi Posted December 4, 2007 Posted December 4, 2007 Hi 1) Show all Records 2) Put the cursor into that field 3) Make a Replace by calculation and calc: Trim ( yourField ) Now all your existing records are correct. But to prevent other errors, put this calc into the auto-enter option of that field ( Remember to uncheck the box "Do not replace existing value of field.." ) Trim ( yourField )
hartmut Posted December 4, 2007 Author Posted December 4, 2007 Thank you Now that I am looking at it there are several times that i would need to extract different amount of words from one field "alltext" to the new field called "member" between 2 symbols like the "•" symbol and the "," but the number of words in between those two symbols might be a different amount sometimes 3 words sometimes 5 words. ex. • the sky is falling , / return "the sky is falling" • every good boy does fine, / return "every good boy does fine"
Raybaudi Posted December 4, 2007 Posted December 4, 2007 Calc for the new field: Let([ start = Position ( alltext ; "•" ; 1 ; 1 ) + 1 ; end = Position ( alltext; "," ; 1 ; 1 ) - start ]; Trim ( Middle ( alltext ; start ; end ) ) )
hartmut Posted December 4, 2007 Author Posted December 4, 2007 thank you it works great i have another place where the varied amount of words exists between two "," (commas) and when i use this text calculation i get a blank field what is the difference? between this "•" and this"," what do i do if i want the words between two commas?
Raybaudi Posted December 4, 2007 Posted December 4, 2007 Let([ start = Position ( alltext ; "," ; 1 ; 1 ) + 1 ; end = Position ( alltext; "," ; 1 ; 2 ) - start ]; Trim ( Middle ( alltext ; start ; end ) ) )
hartmut Posted December 4, 2007 Author Posted December 4, 2007 Thank you danielle I am going to try this with all my projects. You saved my day Thank you again Dave
jeskasper Posted January 26, 2009 Posted January 26, 2009 I have a related problem, that does not seem to be solved by this example. A user can input "Tags" in a field like this: Tag1, Tag two with more info, Tag3 The different tags are seperated by a comma. Now, I want these tags put in a value list, and I used the function "Substitute" to replace the comma with a line break, and then base a value list on this field. This works fine, but then a number of entries begin with a whitespace like this: Tag1 Tag 2 with more details Tag3 If I try to substitute the whitespace with a "", then the result is: Tag1 Tag2withmoredetails Tag3 How do I make sure that only whitespaces coming after a comma gets removed?
LaRetta Posted January 26, 2009 Posted January 26, 2009 You might try: Trim ( Substitute ( text ; [ ", " ; "," ] ; [ "," ; ¶ ] ) )
Recommended Posts
This topic is 5781 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