comp.lang.ada
 help / color / mirror / Atom feed
From: Gautier <gautier@fakeaddress.nil>
Subject: Re: Missing CR/LF in Gnat files?
Date: Sun, 16 Sep 2007 07:16:08 +0200
Date: 2007-09-16T07:16:08+02:00	[thread overview]
Message-ID: <46ecbbdf$1_7@news.bluewin.ch> (raw)
In-Reply-To: <13eoqg17ac9kp58@corp.supernews.com>

Phaedrus wrote:
> Anybody remember anything like that?
This is definitely a UNIX end-of-line problem.
Try harder with your unix2dos (if it works, e.g. with LF & CR/LF mixtures!)...
Indeed, this "Any_filesystem_2_My_filesystem" works pretty well:

-- Transforms line ends from input to output with host convention
-- Stands for Unix2DOS and the like.
--
-- LF:    Unix and Unix-like systems, Linux, AIX, Xenix, Mac OS X,...
-- CR+LF: CP/M, MP/M, DOS, OS/2, Microsoft Windows
-- CR:    Commodore machines, Apple II family and Mac OS through version 9

with Ada.Text_IO;                       use Ada.Text_IO;

procedure Redo_EOLs is
   s: String(1..32_768);
   l: Natural;
begin
   while not End_of_File(Standard_input) loop
     Get_Line(s,l);
     Put_Line(s(1..l));
   end loop;
end Redo_EOLs;

redo_eols <source.txt >dest.txt
and that's it!
HTH
______________________________________________________________
Gautier         -- http://www.mysunrise.ch/users/gdm/index.htm
Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm

NB: For a direct answer, e-mail address on the Web site!



  reply	other threads:[~2007-09-16  5:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-15 22:19 Missing CR/LF in Gnat files? Phaedrus
2007-09-15 23:05 ` Sloan.Kohler
2007-09-15 23:25   ` Phaedrus
2007-09-16  5:16     ` Gautier [this message]
2007-09-16 18:38       ` Jeffrey R. Carter
2007-09-16 22:15         ` Phaedrus
2007-09-16 23:00 ` anon
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox