>I imported a table from CSV to DBF and the result was:
>
>4499 - Mark - Austria - 04/05/2005 - Color TV
>5500 - Jhon - Brazil - 05/05/2005 - Monitor
>5500 - Jhon - Brazil - 05/05/2005 - Color TV
>5500 - Jhon - Brazil - 05/05/2005 - VCR
>5501 - Tom - USA - 06/05/2005 - Sound device
>
>I would like:
>
>4499 - Mark - Austria - 04/05/2005 - Color TV
>5500 - Jhon - Brazil - 05/05/2005 - Monitor, color TV, VCR
>5501 - Tom - USA - 06/05/2005 - Sound device
>
>Could anybody help me treating this table ?
>
>Regards
>
>Moses
select MyTempData
local lcDevices, lcName, lcCountry, lcID
store "" to lcDevices, lcName, lcCountry, lcID
set order to FirstName
scan while !eof()
if lcName <> FirstName
if not empty(m.lcName)
insert into RealTable values (lcID, lcName, lcCountry, ldDate, lcDevices)
endif
lcID = cID
lcCountry = cCountry
lcName = FirstName
lcCountry = cCountry
lcDevices = cDevices
else
lcDevices = lcDevices + ", " + cDevices
endif
endscan
That's off the top of my head, but should give you idea...
If it's not broken, fix it until it is.
My Blog