View previous topic :: View next topic
|
Author |
Message |
Sanjay Mishra
New User
Joined: 16 May 2007 Posts: 3 Location: Novato,California
|
|
|
|
Hi,
In the name of a person field(This is assuming name is in last name, comma, first name, middle initial(optional) format) I want to Remove all characters except characters 'A' THRU 'Z' and '-' '/' ''' ',' ' '
Can Someone help me with example how to do that? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
What do you want to do with the holes left in the field?
Do you want the unwanted characters squeezed out or replaced with something else? |
|
Back to top |
|
|
Sanjay Mishra
New User
Joined: 16 May 2007 Posts: 3 Location: Novato,California
|
|
|
|
Hi William,
Many Thanks for your response .I want unwanted characters squeezed out .
example
*Willi*&am should be converted to William |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
What I did, in a similar requirement, was to set up a "class" in special names and do a perform with reference modification squeezing out, from left to right, the characters that did not fall into that class.... |
|
Back to top |
|
|
Sanjay Mishra
New User
Joined: 16 May 2007 Posts: 3 Location: Novato,California
|
|
|
|
Hi William,
I think We are approaching towards solution .Can You please provide one example for the proposed solution.Many Thanks.
CLASS VALID-CHAR 'A' THROUGH 'Z' , '-' , '/' , "" , ',' , ' '
suppose var1 is *Sanjay Ku*mar Mishra so it should be converted to Sanjay Kumar Mishra |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Sanjay Mishra wrote: |
suppose var1 is *Sanjay Ku*mar Mishra so it should be converted to Sanjay Kumar Mishra |
Special names section is where I would define the characters I wanted to be valid.
Preform varying an if valid move with reference modification will squeeze out the junk....
It's my bedtime.....Tomorrow, but look in the Fine manual, it is not that hard... |
|
Back to top |
|
|
Sharmila Jagadish
New User
Joined: 07 Mar 2006 Posts: 4 Location: Texas, USA
|
|
|
|
Hi,
if you have found a way to do this , please give the details on how to do it. I am interested to know . |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Sharmila Jagadish wrote: |
if you have found a way to do this , please give the details on how to do it. I am interested to know . |
Jeez, what, you have two ids?
It's pretty much a "no brainer"... The clues so far, should be enough, why can't you start to work it out? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Quote: |
It's my bedtime..... |
Go back to bed You've got multiple folks interested.
For the interested folks -
.. did you understand the "class" special-names definition?
.. do you understand reference modification?
If both of those make sense to you, create an "output name" field of the same length as the original. Move spaces to the output name field. Iterate using reference modification on both the input and output name fields move each valid byte from the input field to the output field. Increment both reference modifiers on a valid character and only increment the input modifier when the value is not valid. When the modifier reached the end of the input, your name field has been built.
Put together a small bit of test code and if you have questiojs/problems, post them and someone will have suggestions. |
|
Back to top |
|
|
Sharmila Jagadish
New User
Joined: 07 Mar 2006 Posts: 4 Location: Texas, USA
|
|
|
|
thanks dick scherrer |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
You're welcome
Please let us know how it works for you.
Good luck |
|
Back to top |
|
|
SHAILESH OZA
New User
Joined: 10 Jun 2005 Posts: 21 Location: Mumbai
|
|
|
|
i am telling little bit longer solution but hopefully this will work.
you are taking only last name. genarally last name might be upto 20 to 30 charecters.
just write the code
unstring last-name-field delimited by "," or ";" (write all the special charecter)
into field1,field2,field3, field4.............
After that string field1,field2, field3.......... delimited by SIZE |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Please try your solution before posting. You might use the sample originally posted.
I'm reasonably sure this will not do what was requested. |
|
Back to top |
|
|
|