Scott Evans wrote:
>
> The carriage return is platform-dependent, so Windows and UNIX for example
> represent it differenly. You have to ask the System object what it's using
> to represent it:
>
> char lineSeparator = System.getProperty("line.separator").charAt(0);
or simply use "\r\n".
> -----Original Message-----
> From: Graham Cruickshanks [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 21, 2000 5:09 PM
> To: [EMAIL PROTECTED]
> Subject: ASCII Codes
>
> I'm trying to write a | delimited file for a external program to parse
>
> I.e.
>
> 390129|1326|David Gould|.|18 Huxley Way|Bishops
> Cleave|Cheltenham|Gloucester|GL52|D||0|N|N||1|
> 390129|1326|David Gould|.|18 Huxley Way|Bishops
> Cleave|Cheltenham|Gloucester|GL52|D||0|N|N||1|
>
> The external program reads in the file incorrectly as the carriage return is
> not reconised.
>
> I was using \n to do this but it didn't work, I presume this is a unicode /
> Ascii problem.
>
> how do I write a carriage return in ASCII in java.
>
> I've been trying things like this in my jsp file
>
> <%
> int a = 0x0013;
> int b = 0x0010;
> Character c = new Character( (char)a );
> Character d = new Character( (char)b );
>
> String OutputString = "";
> OutputString = OutputString + "390129|1326|David Gould|.|18 Huxley
> Way|Bishops Cleave|Cheltenham|Gloucester|GL52|D||0|N|N||1|" + d + c;
> OutputString = OutputString + "390129|1326|David Gould|.|18 Huxley
> Way|Bishops Cleave|Cheltenham|Gloucester|GL52|D||0|N|N||1|";
>
> %><%= OutputString %>
>
> but to not joy
>
--
Regards,
Sergey Vorobiev
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets