Hi,
I have a Java Servlet that writes results from a form to a text file.
FileWriter fw = new FileWriter("results", true);
PrintWriter pw = new PrintWriter(fw,true);
pw.print("data");
I ran the servlet on my home computer (using the web server provided by the jsdk) and it...
Exception in thread "main" java.lang.OutOfMemoryError
<<no stack trace available>>
... my program is just parsing a text file of about 200 lines. It looks for the following character ".
Anybody had this problem before?
I meant a stream to directly pull up the information from the text file (without having to delete the null char) =)
A stream that would skip the null char ...
Thanks a lot LittleWing.
That's a really smart solution! Let me know if you find another solution.
I was wondering if you could use another type of stream to handle this type of file ...
By the way there is a faster way to get the text file
msinfo32 /report test.txt /categories +SystemSummary
Hi LeonTang and LittleWing,
I think that the problem is definitely coming from the text file. LittleWing, thanks for the rectification.
If you have a Windows OS, run:
msinfo32 /report test.txt
test.txt is the file I am trying to parse.
As you probably know, it contains information about the...
I used a PrintWriter to write what the program was reading from the original file.
When I opened that file in Word and WordPad, I noticed that there was a weird ASCII character between every character.
It looked like a box. I opened the text file in TextPad and tried to copy the weird...
Hi LeonTang,
I think that I was using StringTokenizer the right way.
I have a file containing information. After the "word", there is the information I need to save into a Java variable.
The text file might look like this; I am looking to save the String "test".
"a...
In StringTokenizer st = new StringTokenizer(line," ");
The " " is actually a tab.
I tried a space, but the System.out.println(line) doesnot give me
% w
% o
% r
% d
but
% w o r d
I am thinking there is a special character ....
Thanks!
Hi,
I am having problem reading from a file. I use StringTokenizer to parse the file and find the word that I am looking for. The problem is that the word is never found; I know its there because I opened the text file.
Since the text file was generated by Windows, I think that there are some...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.