Advertisement

05.22.2008 at 06:21AM PDT, ID: 23424254
[x]
Attachment Details

File parsing of Huge text file(>1 GB) from java

Asked by vsudip in New to Java Programming

Tags: JAVA

Hello experts,
                    I want to parse a huge text file ( greater than 1 GB) from java. This text file has a a lot of rows. What I am trying to do, reading the text file and parse it. so that i can take every data row for further operation. For small file it's working fine, but while passing huge size file , the JVM memory issue occurs. Can any one tell how should I deal with this large file ?
  This time I am using following code.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
FileInputStream fis = new FileInputStream("test.txt");
            int x = fis.available();
            byte b[] = new byte[x];
            fis.read(b);
            message = new String(b);
            ParsingEngineImpl p = new ParsingEngineImpl(message);
            p.parseMessage();
 
Keywords: File parsing of Huge text file(>1 GB…
 
Loading Advertisement...
 
[+][-]05.22.2008 at 06:30AM PDT, ID: 21623602

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.22.2008 at 06:38AM PDT, ID: 21623676

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 09:47AM PDT, ID: 21625510

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 09:57AM PDT, ID: 21625597

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 09:58AM PDT, ID: 21625610

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: New to Java Programming
Tags: JAVA
Sign Up Now!
Solution Provided By: krakatoa
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.29.2008 at 12:54AM PDT, ID: 21667114

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628