🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #3221

Re: Outputing Text with CR LF

#3221
From: James D. Frentress
Date: Thu, 12 Mar 1998 00:00
16 lines
970 bytes
> How do I output text to a file that uses DOS linefeeds  CR LF instead
> of the
> UNIX linefeeds.

this works for me:

      FileOutputStream f = new FileOutputStream("c:\\mytext.txt");
      PrintWriter p = new PrintWriter(f);
      String out = new String();
      p.println("1st line");
      p.println("2nd line");
      p.flush();
      p.close();    // supposedly does a flush but i do one above anyway

Jim
Technical Details
Message-ID: <35082E96.68FC4872@ForAWhile.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6e881t$cbe6@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,276da222d753057e
X-Google-Attributes: gid1089d0,public
From: "James D. Frentress" <Broken@ForAWhile.com>
Subject: Re: Outputing Text with CR LF
Date: 1998/03/12
Message-ID: <35082E96.68FC4872@ForAWhile.com>
X-Deja-AN: 333410012
Content-Transfer-Encoding: 7bit
References: <6e881t$cbe6@forums.borland.com>
X-Priority: 3 (Normal)
Content-Type: text/plain; charset=us-ascii
Organization: Microsoft
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.api