String findTokens:?

Roel Wuyts wuyts at iam.unibe.ch
Wed Apr 23 06:17:03 UTC 2003


You could also use SmaCC to parse the file. It can be found on 
Squeakmap.

It sounds like overkill to use this tool, but believe me, if you know 
what you want to parse this is by far the most robust and easiest way 
:-)

On Tuesday, April 22, 2003, at 10:08 PM, Jimmie Houchin wrote:

> Hello,
>
> I recently ripped a 62cd set into 1189 MP3s nicely done into only 
> 997MBs. :)
> *They are voice only, not music, so 32k mono was sufficient.
>
> With WinAmp I created a playlist of all 1189 MP3s.
> WinAmp encodes Time and Track Name on a comment line.
> It is that data I wish to put into a collection.
>
> A couple of questions.
>
> First here's my code from a workspace.
>
> | file fc ft t1 t2 oc |
> t1 _ '#EXTINF:'.
> t2 _ ',Alexander Scourby - '.
> oc _ OrderedCollection Collection new.
> file _ FileList2 modalFileSelector.
> fc _ file contentsOfEntireFile.
> file close.
>
> ft _ fc findTokens: t1.
> ft inspect.
>
>
> Yes, I know, t2 and oc currently are unused.
>
> 1. I am creating a variable for the file contents and then discarding 
> (closing) the file. Is that good form? Or would it be just as 
> appropriate to assign the file contents into the file variable?
>
> 2. The statement ft _ fc findTokens: t1.  isn't doing what I want.
> It is however, doing what it claims. :)
> I only want the exact string '#EXTINF:' as a token. I do not want it 
> broken down into characters as tokens.
>
>    Is there a way to do such?
>    I have tried a variety of things including 'asSymbol' 
> unsuccessfully.
>
>    If 'findTokens:' cannot be used as such, then I can find other ways 
> to accomplish my task. I just wanted to find out since it seems like a 
> nice way of doing it.
>
>
> Not associated with the problem, but, can Squeak read/edit MP3 ID3 
> tags?
> Is there an editor? If not I wouldn't mind writing one as I learn. But 
> I don't know how to read the tags from the file yet.
>
> Any help greatly appreciated.
>
> Thanks.
>
> Jimmie Houchin
>
>
Roel Wuyts                                                   Software 
Composition Group
roel.wuyts at iam.unibe.ch                       University of Bern, 
Switzerland
http://www.iam.unibe.ch/~wuyts/
Board Member of the European Smalltalk User Group: www.esug.org



More information about the Squeak-dev mailing list