> Hi..im trying to read in a file, that has white
> spaces, indenting and all..an i wana read in all that
> as one string. i cant use realine has it reads in
> line by line...someone told me i should use
> fileinputstream but i dont knw how that's done. thanks
Code removed because the OP is more interested in arguing than in solving his problem.
Message was edited by:
sabre150
Message was edited by:
sabre150
yea but i dont want to do that coz i have the reading in file in my main class. and a separte function that looks for two specific words in that whole string and spits out the content between them. with readline its only line by line.. my main looks like this:
public static void main(String args[])
{
try
{
FileInputStream fstream = new FileInputStream("c:/Program Files/searchResult.xml");
String line;
line = fstream.toString();
System.out.println (line);
fstream.close();
}
catch (Exception e)
{
System.err.println("error");
}
}...
So right now all this does is reads in the file..but the output it gives me is :
java.io.FileInputStream@108786b
any ideas?
> yea but i dont want to do that coz i have the reading
> in file in my main class. and a separte function that
> looks for two specific words in that whole string and
> spits out the content between them. with readline its
> only line by line.. my main looks like this:
Monkey, if this is your new scheme for locating %PDF and %%EOF in a file - we already helped you with this. Dont read the entire file as a string. I dont understand what is so difficult.
> no buddy. This is a different one. and besides im in
> a different forum, coz i realized i should have
> posted here(new to java) in the first place. ur the
> one whos corssposting your reaction. if you have any
> solutions then good, if not then i dont care much for
> your anger
I'm going to *mildly* point out that posting in a different forum is what "crossposting" means. Just a thought.
First: spell out words. cuz, b4, ur...
Second: "no buddy. This is a different one." Your saying in THIS thread that you are looking for 2 markers in a text file and you want the stuff in between. This is almost EXACTLY your problem from yesterday.
The reason people dont like crossposting isnt because we are mean or "angry" people... its b.c. people worked hard to help you yesterday and its not fair to other people today to have to repeat that whole ordeal. Not to mention you never awarded Dukes to the people that did assist you.
> ..if not mind ur own buisness..
Im just explaining the etiquette of the forums to you.
No one is getting paid to help you - so you should at least give
them your respect. Crossposting is considered inconsiderate.
And using abbreviations like "ur, cuz, b4..." just bother people and make
you look dumb.
> no buddy. This is a different one. and besides im in
> a different forum, coz i realized i should have
> posted here(new to java) in the first place. ur the
> one whos corssposting your reaction. if you have any
> solutions then good, if not then i dont care much for
> your anger
It might help if you actually read what has been written! Up to a point I don't mind being ignored but you seem to be turning it into an art form.
> Sorry sabre.. i basically need to have one part of
> the file which is between the two marker
> words.(replying to your earlier post)
In response to a very similar problem, I posted a KMP implementation a week or so ago that will allow you to do this with little or no effort.
> Thanks sabre. Problem is i dont have access to your
> posts which are atleast two days old. So if its not
> much trouble, maybe you can look up ur post history,
> and paste it here.
> Thanks
Would you like a refreshing soda while you wait for that?
> > Thanks sabre. Problem is i dont have access to
> your
> > posts which are atleast two days old. So if its
> not
> > much trouble, maybe you can look up ur post
> history,
> > and paste it here.
> > Thanks
>
> Would you like a refreshing soda while you wait for
> that?
Yes!
> Turingpest..whats the deal with that name anyway?
> well you r pesting me for sure..anwasy this post
> didnt have any duke dollars to begin with. and i knw
> their not worth anything..i wouldnt mind sending him
> real dollars to tell you the truth
It's better to be a turning pest than to be a tripper.
> Turingpest..whats the deal with that name anyway?
http://en.wikipedia.org/wiki/Turing_test
> well you r pesting me for sure..anwasy this post
> didnt have any duke dollars to begin with.
assign some.
> and i knw
> their not worth anything..i wouldnt mind sending him
> real dollars to tell you the truth
the Duke dollars are a symbolic sign of appreciation.
Go here for that KMP implementation:
http://forum.java.sun.com/thread.jspa?threadID=754144&tstart=0
If you were less of a tool I probably wouldve written out that pseudo-code from your last post. I get paid a lot of $ to write code but none to help the ungrateful, lol.
> > > aniseed..u wouldnt knw unless ur trippin my
> buddy
> >
> > Well, this is certainly getting intelligent.
> > Waiter?
>
> Sorry ma'am, that iced latte will be right
> there!
*sigh*.... of course it will. Am I really not allowed to *not* drink coffee around here?
> > > > Yes!
> > >
> > > I'm sorry sir, I was addressing the OP.
> > > I will be right with you.
> >
> > I'll have an iced tea on your way back, waiter.
>
> and I'll have some cough syrup, waiter.
Excellent choice, sir! I see we have a connaisseur in our establishment.
May I recommend the bottle from 1974?
> > > > > Yes!
> > > >
> > > > I'm sorry sir, I was addressing the OP.
> > > > I will be right with you.
> > >
> > > I'll have an iced tea on your way back, waiter.
> >
> > and I'll have some cough syrup, waiter.
>
> Excellent choice, sir! I see we have a connaisseur in
> our establishment.
> May I recommend the bottle from 1974?
Ah! certainly :D
> i also mentioned,, that i realized I had to go "New
> in java" forum ok?
> the other one whatever its called is for advaned
> programmers..i dont wana hear ur naggin awrite...if u
> wana offer me some solution good..if not mind ur own
> buisness..
cn u plz writ in rl englsh?
Cripes. Illiterate bozo.
Travis Bickle... "Gods lonely man", lol.
http://en.wikipedia.org/wiki/Travis_Bickle
What was the fake name he gave the secret service guy on the street?
Robert DeNiro (Travis): You talkin' to me? You talkin' to me? You talkin' to me? Then who the h*ll else are you talkin' to? You talkin' to me? Well I'm the only one here. Who do you think you're talking to? Oh yeah? Huh? Ok.