Re: Parsevar question
"chris.kevany" <[email protected]>
| Newsgroups | gmane.comp.windows.gui4cli |
|---|---|
| Message-ID | <[email protected]> |
Hi Frans, You could keep the database "as is" and at the time you read-in a number of records in a variable, use repVar to change all occasions of ,, into ,"", Text = '2352,Tuesday,2,,Comm,,WhC,C3.68' repvar text ',,' ',"",' ParseVar Text "," say $$Parse.total This is not full-proof however if you also expect empty records at the start or end of the string like; Text = ',2352,Tuesday,2,,Comm,,WhC,C3.68,' Perhaps someone else knows a better solution. Chris --- In [email protected], "Marianne" <marianne976@...> wrote: > > All users > > I need some help with Parsevar if possible please. > > If I open the following in Excel from a csv file > > "2352","Tuesday","2","","Comm","","WhC","C3.68" > > and save it again as comma delimited (csv) from Excel it is saved as" > > 2352,Tuesday,2,,Comm,,WhitingC,C3.68 (unfortunately!!) > > Now let: > > Text = '"2352","Tuesday","2","","Comm","","WhC","C3.68"' > > ParseVar Text "," gives $$Parse.total = 8 > > Next let: > > Text = '2352,Tuesday,2,,Comm,,WhC,C3.68' > > then > > Parsevar text "," gives $$Parse.total = 6 (two fields ignored) > > So When a field is "empty" as in the second example it is not "picked" up by Parsevar. > > If I do have the following it is working but then I must loop through a file of thousands of records looking for two consecutive comas (,,) and replace it with ," ", with a space between "". > > teks = '2352,Tuesday,2," ",Comm," ",WhC,C3.68' > > > Is there an easy way of overcoming this? > > > Any help is appreciated. > > Kind regrads. > > Frans > ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/gui4cli/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/gui4cli/join (Yahoo! ID required) <*> To change settings via email: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/