Re: sort, cut and paste
Re: sort, cut and paste
- Subject: Re: sort, cut and paste
- From: email@hidden
- Date: Tue, 31 Oct 2006 12:49:19 EST
So I guess what you're saying I should do is...
1: Cut the substrings from the main NSString at the calculated offsets
2: Stick the sub strings into an NSArray
3: Sort the Array
Correct?
That should do it. One last thing I need to so is convert the string values
into Numerical values. What is the Cocoa equivilant to the older toolbox call
StringToNum()?
In a message dated 10/28/06 4:37:03 AM, email@hidden writes
> I don't remember offhand what the cut/paste command-line tools do
> exactly, but if you want to split strings at fixed offsets or on a
> certain delimiter, you can use NSString's -substringWithRange: resp. -
> componentsSeparatedByString:, and there's a similar method in
> NSString or NSArray to paste strings together again.
>
> Once you have an array of the strings you need (though you'll
> probably get rows, not columns, so depending on what you're doing you
> may have to do some swapping, but that's easy), you can sort them
> just fine.
>
> Don't use NSTask if that works for you. Apart from the overhead
> launching of processes and passing around the text cause, there's
> other considerations, like escaping special characters, about which I
> blogged a while ago: http://zathras.de/angelweb/x2005-03-10b.htm
>
> Cheers,
> -- M. Uli Kusterer
> http://www.zathras.de
>
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden