• 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
[OT] UNIX heads; can I do this?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OT] UNIX heads; can I do this?


  • Subject: [OT] UNIX heads; can I do this?
  • From: Bill Briggs <email@hidden>
  • Date: Wed, 13 Jun 2007 16:54:31 -0300

I want to take a text file with Mac (cr) line endings and change to UNIX (lf) line endings (eventually I'm piping it to awk, which needs the lf or it sees it all as one line).

So far I can find and clobber all of the cr's, but can't get it to replace with lf's. I'm doing this (where you get the ^M by holding Ctrl and pressing V and Return in sequence). Note that the replace field is empty in the following.

sed -e 's/^M//g' t.txt | cat > b.txt

I've tried replacing with \f, \n, \x0A, and nothing seems to work. I can't seem to determine the magic sauce to get that line feed inserted.

Then again, maybe it's not possible to do that with sed, but I can't see why not.

 - web
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: [OT] UNIX heads; can I do this?
      • From: Emmanuel <email@hidden>
    • Re: [OT] UNIX heads; can I do this?
      • From: "J. Stewart" <email@hidden>
    • Re: [OT] UNIX heads; can I do this?
      • From: "Steven D. Majewski" <email@hidden>
    • Re: [OT] UNIX heads; can I do this?
      • From: John Hawkinson <email@hidden>
References: 
 >Email Change because of SPAM... (Sorry for the RESEND) (From: Don Wieland <email@hidden>)

  • Prev by Date: Email Change because of SPAM... (Sorry for the RESEND)
  • Next by Date: Re: [OT] UNIX heads; can I do this?
  • Previous by thread: Email Change because of SPAM... (Sorry for the RESEND)
  • Next by thread: Re: [OT] UNIX heads; can I do this?
  • Index(es):
    • Date
    • Thread