Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > data extraction, and analysis of text files

Reply
Thread Tools

data extraction, and analysis of text files

 
 
mambenanje@gmail.com
Guest
Posts: n/a
 
      06-26-2006
plz I have a project to read text files and extract data and perform
analysis, so I dont know if ther is any java library readily available
or any techniques or advice or website plz help me

 
Reply With Quote
 
 
 
 
Bart Cremers
Guest
Posts: n/a
 
      06-26-2006

http://www.velocityreviews.com/forums/(E-Mail Removed) schreef:

> plz I have a project to read text files and extract data and perform
> analysis, so I dont know if ther is any java library readily available
> or any techniques or advice or website plz help me


It depends a bit on the format of the text file, but a general approach
would be to read the file using a BufferedReader wrapped around a
FileReader:

BufferedReader reader = new BufferedReader(new
FileReader("inputfile.txt"));

The BufferedReader allows reading the file one line at a time. If no
more lines are available, the readLine() method simply returns 'null':

for (String line = reader.readLine(); line != null; line =
reader.readLine()) {
// Process line
}

To process the line you'll need to use the various available classes
for String manipulation available in Java:

String.split(), String.substring() or StringTokenizer to split the
line in processable parts.
The parse methods in the Number classes to convert number to a
primitive (Integer.parseInt(), ...)
...

Regards,

Bart

 
Reply With Quote
 
 
 
 
mambenanje@gmail.com
Guest
Posts: n/a
 
      07-03-2006
well I think I understand your approach yeah when I read the file I
will use java.util.regex to go through it thanks very much

 
Reply With Quote
 
mambenanje@gmail.com
Guest
Posts: n/a
 
      07-03-2006
well I think I understand your approach yeah when I read the file I
will use java.util.regex to go through it thanks very much

 
Reply With Quote
 
Carlos Eduardo Lima Borges
Guest
Posts: n/a
 
      07-03-2006
I am parsing data from a GPS device.
The data comes separated by commas, it follows the NMEA protocol.
What I want to know is how to parse those strings using *as less memory
as possible*, since I am on the mobile environment, using Java ME (not
Java 5.0 then).

Thanks in advance!

 
Reply With Quote
 
mambenanje@gmail.com
Guest
Posts: n/a
 
      07-06-2006
well I think using the String.split approach will do the job for u and
it create only one array and returns you a reference and such no memory
waste

 
Reply With Quote
 
Carlos Eduardo Lima Borges
Guest
Posts: n/a
 
      07-07-2006
Thanks a lot!

Do you know anyway so that I can check the number of elements created?
It can be either directly, knowing the number of created objects in
memory or indirectly analyzing the size of each element and comparing
to the amount of free memory changed.
I donīt know how either of those approaches can be done nor do I know
any other approaches.
Any help appreciatted

(E-Mail Removed) wrote:
> well I think using the String.split approach will do the job for u and
> it create only one array and returns you a reference and such no memory
> waste


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Evaluating static analysis and Dynamic analysis tools for C/C++ ssubbarayan C Programming 5 11-03-2009 12:50 AM
Data analysis of large collection of XML files Sengly XML 13 11-24-2008 08:37 PM
Text files read multiple files into single file, and then recreate the multiple files googlinggoogler@hotmail.com Python 4 02-13-2005 05:44 PM
Building a Perl based online survey and data gathering, reporting and analysis tool George_V Perl Misc 1 10-05-2004 08:36 AM
input data in asp.net and analysis with pivot table Grey ASP .Net 1 09-24-2004 01:23 PM



Advertisments