Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

ASCII character 13

Thread view: 
Richard Sweeny - 17 Nov 2006 22:22 GMT
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
Mark Rafn - 17 Nov 2006 23:21 GMT
>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    dagon@dagon.net    <http://www.dagon.net/>


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.