Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,468 members, 7,808,677 topics. Date: Thursday, 25 April 2024 at 03:15 PM

Need Assistance With A Java Code - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Need Assistance With A Java Code (1052 Views)

Please Help With Java Code For This Simple App.. / Improve The Speed Of This Java Code. / Assistance With Learning Oracle Sql On A Mac (2) (3) (4)

(1) (Reply) (Go Down)

Need Assistance With A Java Code by Capnd143(m): 4:25pm On Oct 09, 2014
the thing is i want to simply extract text from a text file and store in an array, then
again save those text to another text file, i pretty much got the algorithm(or so i think) but the implementation of the
individual methods seems to be a major headache,


i wrote two methods, one to extract words a single textfile and another to extract words
from many textfiles(up to 2000) , the later seems to work well, but the first keeps throwing a runtimeException
i cant see the bug, so please @javanian @ @allthegurus am all ears (please help out a newbie)

String FileName;
static int i;
void getDisplay(String FileName){
EmailExtract em= new EmailExtract(); //never defined the EMAILEXTRACT OBJECT
//INSIDE THE CONTAINING CLASS TO AVIOD
//STACKOVERFLOW ERROR!!!


// DoExtract();
try{
//
String FileName_=FileName;

{ReadFile File = new ReadFile("C:/Users/eMachine/Documents/I.txt"wink;
String [] arylines= File.OpenFile();

for ( i=0; i < arylines.length; i++ ) {
assert arylines.length!=0 || arylines!=null: "no words found in specified file! err! #2021";
String[] emp=arylines[i].split("\\s+"wink;

System.out.println(emp[i]+" //////////"wink;}
}}
catch(IOException e){System.out.println(e.getMessage());
JOptionPane.showMessageDialog(em,"err! #4041 file not found at specified location"wink;

System.out.println("specified file path not found!"wink;

}


}
Re: Need Assistance With A Java Code by Capnd143(m): 10:18am On Oct 10, 2014
Kimon! Guys! Why fustrating a newbie like this, oh yee @javanian whey art thou, i pray thee to have mercy on a newbie!
Re: Need Assistance With A Java Code by AZeD1(m): 10:56am On Oct 10, 2014
Have you tried debugging using break points to know the line/statement causing the error?
Re: Need Assistance With A Java Code by Javanian: 12:50pm On Oct 10, 2014
brb
Re: Need Assistance With A Java Code by Capnd143(m): 2:41pm On Oct 10, 2014
AZeD1:
Have you tried debugging using break points to know the line/statement causing the error?
i tried doing that, bt am no master at breakpoint issues, and i have no way to get the loop variables at each program state, just after the series of state(process of looping ends) have been completed, would appreciate any help
Re: Need Assistance With A Java Code by Capnd143(m): 2:44pm On Oct 10, 2014
Javanian:
brb
if this is your idea of bailing on me! Sorry ur busted! Brb since when? Waiting...
Re: Need Assistance With A Java Code by Javanian: 11:06pm On Oct 10, 2014
Capnd143:
if this is your idea of bailing on me! Sorry ur busted! Brb since when? Waiting...

Post your entire code so i can reproduce the exception.
Re: Need Assistance With A Java Code by Capnd143(m): 8:15pm On Oct 12, 2014
Javanian:


Post your entire code so i can reproduce the exception.
apart from my Main class which am just supposed to call this method( i.e one with issues) this is the entire code for the class, other codes are unrelated, you can re-implement the method if you want.
ยง all i want to do is create an object from the readfile class and use that object to read a text file, split into words, store in an array and out a sorted array!

(1) (Reply)

Crazy Fly Bird New Game - DOWNLOAD NOW - Review And Win / How To Promote Your Mobile Application Download Online / 5 Web Best Practices

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 15
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.