I have a column of strings separated by comma.
Example: City, Zipcode
I want to make a column with only city populated so everything before the comma.
How has anyone else accomplished this? I know with Foxpro you can usually accomplish the same task various ways. Any help would be appreciated.
EDIT: SOLUTION
GETWORDNUM(FIELD,1,",")
This worked to give the text string before the comma from the column FIELD.
The easiest way to do that is to use STREXTRACT(). ie:
lcColumnData = "City, Zipcode"
? STREXTRACT(m.lcColumnData, "",",")
STORE ALINES(aCZ, "Atlanta, 30301", ",") TO iCZ
City = aCZ[1]
ZipCode = aCZ[2]
?City
?ZipCode
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With