Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple parse????

Status
Not open for further replies.

futbwal15

IS-IT--Management
Jan 12, 2007
38
0
0
US
say i have a field that lists car year, car manufacturer, and car model.....is it possible to parse this into 3 different outputs? considering they will be different lengths?
 
now the only problem is that if data runs through that reads 2003 Pontiac Grand Am........i get 2003 in a column.....Pontiac Grand in a column, and then Am in a column in stead of 2003,pontiac, grand am
 
Using parsing techniques will not solve your problem.


-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
futbwal15,
how many records you have in that table (fileinfo)?
Better add 3 other fields (and please don't make them TEXT) and keep there the year, Manufacturer and model. You could use the examples here to split the custom1 field to other fields and then remove that field (custom1). Of course you must change all program logic in your FrontEnd, but this is ONE-time job and that will makes you life much easier that now.

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
Personally, at this point in your data, I would probably create a new table called CarManufacturer. Put all of the car makers in that table. Then create three new columns in your original table (ModelYear, CarMaker, CarModel). Copy the year to the new ModelYear column. Then use the CarManufacturer table to compare with the rest of the string and move that value to CarMaker. Then move what is left to the CarModel table. Once you've split up the current string into its three parts and matching columns, drop the CarManufacturer table.

(You could also keep the CarManufacturer table and link it to the original table via Primary/Foreign key relationship).

-SQLBill

Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top