Csound Csound-dev Csound-tekno Search About

Re: a text formatting/Executor question

Date1997-04-24 15:36
FromGeorge Campbell
SubjectRe: a text formatting/Executor question
> From owner-csound-outgoing@maths.exeter.ac.uk Thu Apr 24 10:23 EDT 1997
> Subject: Re: a text formatting/Executor question
> Date: Thu, 24 Apr 97 07:06:09 -0700
> From: Tom Erbe 
> To: "Dave Phillips" , 
> 
> >I'm using the the Mac CornBucket score generator via Linux Executor: it
> >works okay, but the formatting is bad. Here's what I get:
> >
> >  f1 0 8192 10 1^Mi1 0.000000 0.000100 10200.301758 50.250000 0.500000
> >0.546584^Mi1   0.001000 0.000096 9985.474609 50.348255 0.499969
> >0.543260^M
> >  [etc. for a gazillion lines all run together like that]
> 
> This is a problem with Mac/Unix line feed incompatibility. You can fix
> it with BBEdit on the Mac side (open the file, "Save As...", select 
> "Options...", select "Line Breaks->Unix",save). You could also probably
> fix this with sed on the Unix side. It has been a while since I have
> had to use sed to do this, can anyone suggest the proper invocation
> to convert Mac line-feeds to Unix line-feeds?
> 
> tom erbe

  I don't know about Mac line ending conventions, but there are a couple
  of utilities on my UNIX (Solaris 2.5) that can be used to convert
  text files from UNIX to DOS and vice versa. They're call "unix2dos"
  and "dos2unix". The "unix2dos" utility adds a carriage return before
  line feeds, and "dos2unix" strips out carriage returns, leaving just
  the line feeds, which is what UNIX expects as a line terminator. The
  "^M"s in that excerpt from the file are carriage returns. Presumably,
  the "dos2unix" utility would also work on MAC files.
  
  George