Guest_imported
New member
- Jan 1, 1970
- 0
Hello,
I get a good string parsing when the delimiter is a comma. This works fine when the comma is properly placed. But! some commas in the data field are stuck right next to the following letters, like this.
Morgan Jim ,66 Hefty st, Los Angeles, Ca.,lawyer
It will not pick up the comma before 66 Hefty st since it is stuck right up against the letter. Can anyone give me ideas how to sort this thing out? This code here works fine!! while the comma is properly placed.
SELECT data2&& data is a field called "data"
GO TOP
SCAN
IF EMPTY(DEX2.A1)
replace all Data2.a1 with left(data,at(",",data)-1)
replace all Data2.a2 with substr(data,at(",",data)+1,at; (',',data,2)-at(",",data)-1)
replace all Data2.a3 with substr(data,at(",",data,2)+1,at;(',',data,3)-at(",",data,2)-1)
replace all Data2.a4 with substr(data,at(",",data,3)+1,at; (',',data,4)-at(",",data,3)-1)
replace all Data2.a5 with substr(data,at(",",data,4)+1,at;(',',data,5)-at(",",data,4)-1)
jonezbuz@aol.com
I get a good string parsing when the delimiter is a comma. This works fine when the comma is properly placed. But! some commas in the data field are stuck right next to the following letters, like this.
Morgan Jim ,66 Hefty st, Los Angeles, Ca.,lawyer
It will not pick up the comma before 66 Hefty st since it is stuck right up against the letter. Can anyone give me ideas how to sort this thing out? This code here works fine!! while the comma is properly placed.
SELECT data2&& data is a field called "data"
GO TOP
SCAN
IF EMPTY(DEX2.A1)
replace all Data2.a1 with left(data,at(",",data)-1)
replace all Data2.a2 with substr(data,at(",",data)+1,at; (',',data,2)-at(",",data)-1)
replace all Data2.a3 with substr(data,at(",",data,2)+1,at;(',',data,3)-at(",",data,2)-1)
replace all Data2.a4 with substr(data,at(",",data,3)+1,at; (',',data,4)-at(",",data,3)-1)
replace all Data2.a5 with substr(data,at(",",data,4)+1,at;(',',data,5)-at(",",data,4)-1)
jonezbuz@aol.com