• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Mac vs unix Carriage returns on a text file format
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Mac vs unix Carriage returns on a text file format (From: Dan Doughtie <email@hidden>)

  • Prev by Date: Mac vs unix Carriage returns on a text file format
  • Next by Date: Re: How to make AppleScript wait for FileMaker to complete a script?
  • Previous by thread: Mac vs unix Carriage returns on a text file format
  • Next by thread: Re: Mac vs unix Carriage returns on a text file format
  • Index(es):
    • Date
    • Thread