View previous topic :: View next topic
|
Author |
Message |
mahesh bhavikatti
New User
Joined: 08 Dec 2007 Posts: 6 Location: bangalore
|
|
|
|
Hi,
There are 8 address lines
addr-1
addr-2
addr-3
addr-4
addr-5
addr-6
addr-7
addr-8
Now i need to move addr-1 to addr-2 similarly for all other and
ws-special-name to addr-1.
While moving if any occurrences of address -line-x(x=1-8) are spaces then move up by 1 occurrence(addr-1 to addr-2 ,addr-2 to addr-3) e.g if addr-2 = spaces then addr-3 should be moved to addr-3. |
|
Back to top |
|
|
mahesh bhavikatti
New User
Joined: 08 Dec 2007 Posts: 6 Location: bangalore
|
|
|
|
Please let me know incase incase the query is not clear. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Mahesh,
Quote: |
Please let me know incase incase the query is not clear. |
You are correct. Need some examples also. |
|
Back to top |
|
|
mahesh bhavikatti
New User
Joined: 08 Dec 2007 Posts: 6 Location: bangalore
|
|
|
|
ex values of the address are
addr1 = mahesh
addr2= kumar
addr3= bhavika
addr4= spaces
addr5= spaces
addr6= cross
addr7= house
addr8= pincode
ws-special-name = bank, This will be moved to addr1 so the values i need is
addr1 = bank
addr2= mahesh
addr3= kumar
addr4= bhavika
addr5= cross
addr6= house
addr7= pincode
addr8= spaces(For addr8 if value is there then we can move or else default it will be spaces)
Hope this helps ... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Are all of the addr fields the same length? If they are, you could define one array of the 8 input values and another array to build the output values.
Move spaces to the output array.
Your process would check the "special" name and if it is not blank, move that value to the first occurance of the output array (and set the current output index/subscript to the second entry).
The input array "current" occurance would be checked for spaces and if not, moved to the current output occurance. Both index/subscript values woule be incremented.
If the "input" value was spaces, the input array would be incremented with no move to the output array (and no output array increment).
Continue like this until done with the input array. When all of the input array has been processed, the final values are in the output array. |
|
Back to top |
|
|
mahesh bhavikatti
New User
Joined: 08 Dec 2007 Posts: 6 Location: bangalore
|
|
|
|
Thank you .... D.sch |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome
We're here if there are questions.
d |
|
Back to top |
|
|
|