On Jun 18, 2012, at 12:22 AM, Appa Rao Mulpuri wrote:

> Basically I need to construct two dictionaries from that file. One with 'ID' 
> vs 'Actual String' as Key-Value pairs and second one with 'String ID' Vs 
> 'Actual String' as Key-Value pairs.


Do you even need a real parser for this? Parser generators are great, but they 
tend to have enough of a learning curve and runtime overhead that they may be 
overkill for something this simple.

Just use -rangeOfString:options:range: to locate the first two "=" in each 
line, then grab the three substrings that they're separated by. (You could even 
use -componentsSeparatedByString:@"=" if you were 100% sure that the freeform 
text in the third field never contains an "=".)

Or, on 10.7/iOS5, you can use NSRegularExpression.

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to