By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,538 Members | 1,130 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,538 IT Pros & Developers. It's quick & easy.

ASCII character 13

P: n/a
I will be supplied a file of names delimited by the ASCII character 13.
I know in AppleScript I would set this :

set cr to ASCII character 13

How do I refer or set this in java. I figure I can read the file in an
use a StringTokenizer to go through the file to pull the names but how
do I refer to ASCII character 13 as the delimiter.

Thanks,
Rich
Nov 17 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Richard Sweeny <ri********@optonline.netwrote:
>I will be supplied a file of names delimited by the ASCII character 13.
Sounds like an old-school mac textfile.
>How do I refer or set this in java.
Generally, you don't. Throw a BufferedReader at that puppy, and readLine() to
your heart's content!
>I figure I can read the file in an
use a StringTokenizer to go through the file to pull the names but how
do I refer to ASCII character 13 as the delimiter.
The javadoc for java.io.BufferedReader.readLine says:
A line is considered to be terminated by any one of a line feed ('\n'), a
carriage return ('\r'), or a carriage return followed immediately by a
linefeed.

This means it'll do the right thing with textfiles from unix, mac, or dos.
--
Mark Rafn da***@dagon.net <http://www.dagon.net/>
Nov 17 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.