Give a beggar a fish; feed him for a day. Teach him how to fish; Feed him for a lifetime.
What am I going to do???
Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
Give a beggar a fish; feed him for a day. Teach him how to fish; Feed him for a lifetime.
I think you would have to explain it more briefly, because people won’t bother reading 400 lines of code.Stanley Mungai wrote:Am trying to post My code but It simply wont come.. . . .
I think you would have to explain it more briefly, because people won’t bother reading 400 lines of code.
Give a beggar a fish; feed him for a day. Teach him how to fish; Feed him for a lifetime.
Stanley Mungai wrote:Hi People, I have a Program that does the following functions:
1. Reads from a folder and split a text file into many text files:
2. Read from the many text files and validate if they contain an e-mail address. If not they are deleted.
3. The remaining text files(with valid E-mail addresses) are converted to PDF and e-mailed to respective persons.
This is my problem. When I run the program, it does the function number one and stops.
When I run it again, it does Number 2 and stops
I run it the third time and it dos number 3.
Give a beggar a fish; feed him for a day. Teach him how to fish; Feed him for a lifetime.
Stanley Mungai wrote:Thank you Jesper de Jong for that insight. I now have the Program Running in one Cycle. But I got a Null Pointer Exception on Line 193.
Note the Program is not stopping even after the Null Pointer exception it works just fine.
Give a beggar a fish; feed him for a day. Teach him how to fish; Feed him for a lifetime.
Matthew Brown wrote:I think if you've got a main method (or any other method) that's over 400 lines long, you've got problems whether it works or not. If you break your program into smaller, more manageble, pieces there's a good chance that you'll realise what the problem is. And if you don't, then it will be easier for others to help you.
Stanley Mungai wrote:Thank you Jeff. I handled the Exception.
Give a beggar a fish; feed him for a day. Teach him how to fish; Feed him for a lifetime.
Stanley Mungai wrote:Did
And the Exception Disappeared.
Give a beggar a fish; feed him for a day. Teach him how to fish; Feed him for a lifetime.
Stanley Mungai wrote:What is the best way then to handle that Kind of an exception?
Give a beggar a fish; feed him for a day. Teach him how to fish; Feed him for a lifetime.
Stanley Mungai wrote:Did
And the Exception Disappeared.
Stanley Mungai wrote:I can tell you it is returning null for a line that is not null. I already Indicated that the first line of that text file is not null.
Give a beggar a fish; feed him for a day. Teach him how to fish; Feed him for a lifetime.
Give a beggar a fish; feed him for a day. Teach him how to fish; Feed him for a lifetime.
Stanley Mungai wrote:Well, I have thousands of text files am reading Probably there is one that is returning null, But check am removing blank lines from the files on line 120 of the Code pasted above. Unless there is a line that has not been removed which I seriously doubt because I am using that first Line for authentication password and all the files are password encrypted.
![]()
Don't mess with me you fool! I'm cooking with gas! Here, read this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
|