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 / June 2006

Tip: Looking for answers? Try searching our database.

Reading  only numbers from a file

Thread view: 
meena.sekaran@gmail.com - 25 Jun 2006 10:12 GMT
hi all

     i need a code for reading only numbers from file and not the
letters.
for ex if i have emp name and salary i have to reda only salary.
Henry - 25 Jun 2006 13:37 GMT
> hi all
>
>       i need a code for reading only numbers from file and not the
> letters.
> for ex if i have emp name and salary i have to reda only salary.

The code to read data from a file always depends on how the file is
organized and you haven't told us that.

A standard text file (sometimes called a "flat" file), is usually
organized into lines that end with carriage returns and/or line feeds.
To read a file like this, you open the file, wherever it is, then use a
loop to read the file one line at a time until there are no more lines,
then you close the file. As you read each line, you parse it, i.e. you
analyze it and grab the parts that you want and ignore the parts you
don't want.

But many files are not organized this way and need different techniques
to read them. For example, a zip file is a more complex file: it is a
file that contains other files. And a binary file, like a JPEG or MP3,
is also organized different from a text file.

Therefore, your question isn't answerable: it doesn't give any
information about the organization of the file. If it is a standard
format, please state what format it is. If it is not a standard format,
can you post a few lines of it? Then, maybe, we'll be able to figure
out what it is so that we can advise you on how to read it.

--
Buzz


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.