Re: Was: Unix(LF) files to MSDOS(CRLF) and vice versa

2002-04-20 Thread will trillich
On Tue, Apr 09, 2002 at 04:14:25AM -0500, Elizabeth Barham wrote:
 Kerstin Hoef-Emden [EMAIL PROTECTED] writes:
  Are similar tools to flip and dos2unix available for converting
  Mac-ASCII texts?
 
 perl works well.
 
 perl -i -pe 's/\r/\n/g' [filename...]
 
 the -i means to edit the files in place. See perl --help for more
 information on it.

mac files use '\015' for end-of-line, whereas pc files use
'\015\012'. (and in macperl, \n == \015, by the way, instead of
everyone else's \012.)

-- 
I use Debian/GNU Linux version 2.2;
Linux server 2.2.17 #1 Sun Jun 25 09:24:41 EST 2000 i586 unknown
 
DEBIAN NEWBIE TIP #56 from Vineet Kumar [EMAIL PROTECTED]
:
Troubled by DOS-FORMAT OR MAC-FORMAT TEXT FILES? Here's another
way to deal with those troublesome ^M characters: a simple
tr -d '\015'   dos.file   reg.file
should do the trick.  While we're on the subject, a Mac file
can be converted with
tr '\015' '\012'   mac.file   reg.file
You can do all your CR/LF translations with tr as long as you
can remember that macs use CRs, *nices use LFs, and DOS uses
CR+LF.

Also see http://newbieDoc.sourceForge.net/ ...


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



[SOLVED] Re: Unix(LF) files to MSDOS(CRLF) and vice versa

2002-04-14 Thread Daniel Toffetti
  How can I use rpl (or any other suitable command) to transform the
  \n character between Unix and Msdos formats ?? rpl seems to be
  the right tool, but I can't figure out how to specify that strings.

 Lots of good answers, let's not forget trusty old tr, it's feeling
 neglected. The key thing you need to know is the standard  cr/lf
 sequence for text files:

 Mac   ^M  013   0x0D\r
 Win   ^M^J013 010   0x0D 0x0A   \r \n
 'nix  ^J  010   0x0A\n

 PM

Thanks !! Already solved it with unix2dos.

-- 
Daniel Toffetti --- 'There is no spoon...' - The Matrix

Running the bleeding edge Debian Sid version 3.0
Linux luni 2.4.13 #1 SMP Sun Oct 28 18:30:53 ART 2001 i686 unknown


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Unix(LF) files to MSDOS(CRLF) and vice versa

2002-04-12 Thread Paul Mackinney
Daniel Toffetti declaimed:
 Hi !
 
 How can I use rpl (or any other suitable command) to transform the \n 
 character between Unix and Msdos formats ?? rpl seems to be the right 
 tool, but I can't figure out how to specify that strings.
 
 Thanks !!
 
 -- 
 Daniel Toffetti --- 'There is no spoon...' - The Matrix
 
 Running the bleeding edge Debian Sid version 3.0
 Linux luni 2.4.13 #1 SMP Sun Oct 28 18:30:53 ART 2001 i686 unknown
 
 
 --
 To UNSUBSCRIBE, email to [EMAIL PROTECTED]
 with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
 
Lots of good answers, let's not forget trusty old tr, it's feeling
neglected. The key thing you need to know is the standard  cr/lf
sequence for text files:

Mac   ^M  013   0x0D\r
Win   ^M^J013 010   0x0D 0x0A   \r \n
'nix  ^J  010   0x0A\n

PM
-- 
Paul Mackinney
[EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Unix(LF) files to MSDOS(CRLF) and vice versa

2002-04-09 Thread Sean 'Shaleh' Perry

On 09-Apr-2002 Crispin Wellington wrote:
 On Tue, 2002-04-09 at 10:42, Daniel Toffetti wrote:
 Hi !
 
 How can I use rpl (or any other suitable command) to transform the \n 
 character between Unix and Msdos formats ?? rpl seems to be the right 
 tool, but I can't figure out how to specify that strings.
 
 Thanks !!
 
 I know how to get rid of the msdos crap, but not how to put it back
 
 cat text.txt | sed -e 's/^M//g'  text2.txt
 
 But the crux is you get the ^M in the command line by typing ctrl-v and
 then pressing return.
 

see the message above your.  unix2dos and dos2unix are the friend of anyone
having to move files back and forth.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Unix(LF) files to MSDOS(CRLF) and vice versa

2002-04-09 Thread Alex Malinovich
On Mon, 2002-04-08 at 21:42, Daniel Toffetti wrote:
 Hi !
 
 How can I use rpl (or any other suitable command) to transform the \n 
 character between Unix and Msdos formats ?? rpl seems to be the right 
 tool, but I can't figure out how to specify that strings.
 

flip is your friend:

apt-get install flip

lots of really useful command-line options. (You can even flip binary
files if you're so inclined.)

-Alex


signature.asc
Description: This is a digitally signed message part


Was: Unix(LF) files to MSDOS(CRLF) and vice versa

2002-04-09 Thread Kerstin Hoef-Emden

Hi,

On 9 Apr 2002, Alex Malinovich wrote:

 On Mon, 2002-04-08 at 21:42, Daniel Toffetti wrote:
  Hi !
 
  How can I use rpl (or any other suitable command) to transform the \n
  character between Unix and Msdos formats ?? rpl seems to be the right
  tool, but I can't figure out how to specify that strings.
 

 flip is your friend:

 apt-get install flip

 lots of really useful command-line options. (You can even flip binary
 files if you're so inclined.)

Are similar tools to flip and dos2unix available for converting
Mac-ASCII texts?



Regards,

Kerstin


-- 

Dr. Kerstin Hoef-Emden  Gyrhofstr. 15
Universität zu Köln 50931 Köln
Botanisches InstitutGermany


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Was: Unix(LF) files to MSDOS(CRLF) and vice versa

2002-04-09 Thread Elizabeth Barham
Kerstin Hoef-Emden [EMAIL PROTECTED] writes:
 Are similar tools to flip and dos2unix available for converting
 Mac-ASCII texts?

perl works well.

perl -i -pe 's/\r/\n/g' [filename...]

the -i means to edit the files in place. See perl --help for more
information on it.

Elizabeth


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Was: Unix(LF) files to MSDOS(CRLF) and vice versa

2002-04-09 Thread Pietro Cagnoni

Kerstin Hoef-Emden wrote:

Hi,

On 9 Apr 2002, Alex Malinovich wrote:



On Mon, 2002-04-08 at 21:42, Daniel Toffetti wrote:


Hi !

How can I use rpl (or any other suitable command) to transform the \n
character between Unix and Msdos formats ?? rpl seems to be the right
tool, but I can't figure out how to specify that strings.



flip is your friend:

apt-get install flip

lots of really useful command-line options. (You can even flip binary
files if you're so inclined.)



Are similar tools to flip and dos2unix available for converting
Mac-ASCII texts?


recode is a very general character conversion tool.

apt-get install recode

pietro.




--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Unix(LF) files to MSDOS(CRLF) and vice versa

2002-04-09 Thread Daniel Toffetti
  How can I use rpl (or any other suitable command) to transform the
  \n character between Unix and Msdos formats ?? rpl seems to be
  the right tool, but I can't figure out how to specify that strings.

 In the sysutils package, there are utilities to do this. Look at the
 manpages for dos2unix and unix2dos.

#%[EMAIL PROTECTED](*) !!!  I've been looking for unix2dos, but failed to find 
it 
in dselect and apt-cache search.

 FYI: If you send text files through FTP using ascii mode, it will
 also translate carriage returns.

Only for local use by now, thanks !

(*) Don't try this at your console... :)
-- 
Daniel Toffetti --- 'There is no spoon...' - The Matrix

Running the bleeding edge Debian Sid version 3.0
Linux luni 2.4.13 #1 SMP Sun Oct 28 18:30:53 ART 2001 i686 unknown


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Unix(LF) files to MSDOS(CRLF) and vice versa

2002-04-09 Thread Daniel Toffetti
  How can I use rpl (or any other suitable command) to transform the
  \n character between Unix and Msdos formats ?? rpl seems to be
  the right tool, but I can't figure out how to specify that strings.

 apt-get install flip

 lots of really useful command-line options. (You can even flip
 binary files if you're so inclined.)

Binary files ?? Not that masochistic yet, I have to learn perl first :)

Thanks !

-- 
Daniel Toffetti --- 'There is no spoon...' - The Matrix

Running the bleeding edge Debian Sid version 3.0
Linux luni 2.4.13 #1 SMP Sun Oct 28 18:30:53 ART 2001 i686 unknown


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Unix(LF) files to MSDOS(CRLF) and vice versa

2002-04-09 Thread Richard Cobbe
Lo, on Tuesday, April 9, Daniel Toffetti did write:

   How can I use rpl (or any other suitable command) to transform the
   \n character between Unix and Msdos formats ?? rpl seems to be
   the right tool, but I can't figure out how to specify that strings.
 
  In the sysutils package, there are utilities to do this. Look at the
  manpages for dos2unix and unix2dos.
 
 #%[EMAIL PROTECTED](*) !!!  I've been looking for unix2dos, but failed to 
 find it 
 in dselect and apt-cache search.

On woody:

[nanny-ogg:~]$ apt-file search unix2dos
sysutils

Richard


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Unix(LF) files to MSDOS(CRLF) and vice versa

2002-04-08 Thread Daniel Toffetti
Hi !

How can I use rpl (or any other suitable command) to transform the \n 
character between Unix and Msdos formats ?? rpl seems to be the right 
tool, but I can't figure out how to specify that strings.

Thanks !!

-- 
Daniel Toffetti --- 'There is no spoon...' - The Matrix

Running the bleeding edge Debian Sid version 3.0
Linux luni 2.4.13 #1 SMP Sun Oct 28 18:30:53 ART 2001 i686 unknown


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Unix(LF) files to MSDOS(CRLF) and vice versa

2002-04-08 Thread traxlend
On Mon, Apr 08, 2002 at 11:42:15PM -0300, Daniel Toffetti wrote:
 Hi !
 
 How can I use rpl (or any other suitable command) to transform the \n 
 character between Unix and Msdos formats ?? rpl seems to be the right 
 tool, but I can't figure out how to specify that strings.

In the sysutils package, there are utilities to do this. Look at the 
manpages for dos2unix and unix2dos.

FYI: If you send text files through FTP using ascii mode, it will also
translate carriage returns.

--
Nick


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Unix(LF) files to MSDOS(CRLF) and vice versa

2002-04-08 Thread Crispin Wellington
On Tue, 2002-04-09 at 10:42, Daniel Toffetti wrote:
 Hi !
 
 How can I use rpl (or any other suitable command) to transform the \n 
 character between Unix and Msdos formats ?? rpl seems to be the right 
 tool, but I can't figure out how to specify that strings.
 
 Thanks !!

I know how to get rid of the msdos crap, but not how to put it back

cat text.txt | sed -e 's/^M//g'  text2.txt

But the crux is you get the ^M in the command line by typing ctrl-v and
then pressing return.

Crispin



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]