[Newbies] Parsing and splitting file contents
herbertkoenig at gmx.net
Sat Aug 29 14:00:48 UTC 2009
ru> I am reading a tab delimited file into a string. I want to
ru> iterate through this string and split by tab, or any other defined
ru> value (, . | # tab, cr, etc.), delimiter into substrings which are
ru> assigned to a Collection (Array, Dictionary, Bag, etc.), or
ru> instant variables.
String>>findTokens is your friend here.
And FileStream>>contentsOfEntireFile gets the whole file into a string
before you find the tokens. But I'd prefer to read the file one line
at a time into a collection of strings.
More information about the Beginners