Article View: borland.public.jbuilder.java.language
Article #15198Trying to create a new line in an output file?
From: Eric Advincula
Date: Sun, 04 Jul 1999 00:00
Date: Sun, 04 Jul 1999 00:00
49 lines
1877 bytes
1877 bytes
Trying to output a new line to a file. This is just a snipet of code (but
works correctly excep the problem below ) and does output the file as it
reads in another file. The only difference is this:
Reading in input file:
[Test]
Value=123
Test=True
when outputing it does the following:
[Test]Value=123Test=True
I tried the write( '\n' ) for a new line but doesnt do it.
Any ideas?
Thanks
Ex.
public boolean blUseDebugMode = false;
private File inputFile = null;
private File outputFile = null;
private File tempFile = null;
private FileInputStream inputStream = null;
private FileInputStream tempStream = null;
private FileOutputStream outputStream = null;
private DataInput aDI = null;
private DataInput aTemp = null;
private DataOutput aDO = null;
public final int READ_FILE = 100;
public final int WRITE_FILE = 101;
String sInputLine = null;
String sInputFilePath = null;
String sTempInputFilePath = null;
String sOutputFilePath = "c:\\tmp.ini";
while(( sInputLine = aTemp.readLine()) != null )
{
sbModifiedLine = new StringBuffer( sInputLine );
// Writes the output
aDO.writeBytes( sbModifiedLine.toString() );
aDO.write( '\n' );
}
return true;
}
Technical Details
Message-ID:
<7ln468$7266@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,6eca38836f6f34eb,start X-Google-Attributes: gidf74b3,public From: "Eric Advincula" <eric07@earthlink.net> Subject: Trying to create a new line in an output file? Date: 1999/07/04 Message-ID: <7ln468$7266@forums.borland.com> X-Deja-AN: 496987115 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.language