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.
I personally use BBEdit, which is useful for many other tasks as well. But lots of OSX applications use unix line breaks now: TextEdit does, and Nisus, and others.
Nick Cahill
On May 12, 2005, at 4:18 PM, Jeroen Wortel wrote:
Hi all,
I was wondering how other Grass users on Mac OS X convert linux/unix ASCII files to Mac ASCII files.
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.
Thanks,
-Jeroen.
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.8 - Release Date: 10-5-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.
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.
Was it realy fixed in all modules which take text as input?
Thanks Nick, Graham, Radim, Hamish for your reactions.
Hamish wrote:
>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?
You're right of course, I'm coverting the other way around.
>Alternatively you can download the development CVS-snapshot OSX binaries
>from Lorenzo's website & help try out the new code.
I'm working myself on Linux and help others out in using Grass and they work on a Mac. Next time I'm around a Mac I'll download the binaries and try them out. thanks.
-Jeroen.
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.9 - Release Date: 12-5-2005