Re: Mac vs unix Carriage returns on a text file format
Re: Mac vs unix Carriage returns on a text file format
- Subject: Re: Mac vs unix Carriage returns on a text file format
- From: Adam Wuellner <email@hidden>
- Date: Thu, 31 Mar 2005 12:54:27 -0600
On Thu, 31 Mar 2005 13:08:53 -0500, Dan Doughtie
<email@hidden> wrote:
> Is there any syntax to save a text file through the Finder and tell it to
> save it as Mac linefeeds? Or will I have to open it in a scriptable app and
> let the app do it?
Finder won't do it. You can script BBEdit, or the free TextWrangler,
to do it, but it will be visually noisy (docs opening and closing and
whatnot).
Another alternative is to process the file with tr(1).
<from 'man tr'>
DESCRIPTION
The tr utility copies the standard input to the standard output with sub-
stitution or deletion of selected characters.
</man tr>
example:
tr '\r' '\n' <input.txt >output.txt
(converts carriage returns (mac line endings) to linefeeds (unix endings))
Call that, or similar, with 'do shell script'.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden