[GRASSLIST:6769] Re: using linux/unix ASCII files on Grass MAC OS X

Hamish hamish_nospam at yahoo.com
Thu May 12 21:47:02 EDT 2005


> I was wondering how other Grass users on Mac OS X convert linux/unix
> ASCII files to Mac ASCII files.
> 
> I use
>          tr '\012' '\015' < unix-format-file > mac-friendly-fil

Note OS/X and newer now uses UNIX formatted newlines. Only software
written for Mac OS9 and older should need Mac formatted new lines.
i.e. are you sure you really need to go back to the old format?
 
> Is there an option in Grass to do this automatically for ASCII files?
> Most  Mac apps cater for this by detecting the proper line endings
> themselves.  Such an autodetection would be great for Grass on Mac OS
> X since a lot of  ascii files come from linux users.

Linux/UNIX files should work natively with any Mac app written for OSX.
OSX writes in UNIX format itself.

Auto detection and conversion at input time of old Mac->UNIX format has
already been fixed for GRASS in CVS, and will appear in the next
version. DOS formatted text is already supported in the current
version.

Until then you'll have to use tr, BBedit, nedit, mac2unix, etc to
re-save MaxOS9 files in UNIX format before trying to use them with GRASS.
(check what kind of file it is with the 'file data.txt' command)

Alternatively you can download the development CVS-snapshot OSX binaries
from Lorenzo's website & help try out the new code.


Apps like Microsoft's Excel .csv text output and files saved from 
Internet Explorer (but Safari works fine) will save text files in the
old MacOS9 format. Most Apple software I've come across gets it right.


Graham: it works, you seem to be on the right track, keep trying.
It is a matter of getting UNIX newlines and the fs= option correct.



Hamish




More information about the grass-user mailing list