Question on IO redirection

Hey guys,

I’ve a bit of a problem concerning IO redirection. I was just wondering is it possible to make a program automatically store strings from a text file in an array. This problem isn’t to do with homework this time, its more a personal query.

Thanks guys!

Hauk

Ehm, guys! for once this has nothing to do with homework! I’m just curious as using it as an alternative to typing in reams of strings!!!

Please help!!

Hauk

You could do something like this


Vector lines<String> = new Vector<String>();
BufferedReader br = new BufferedReader(...);
String temp;
temp = br.readLine();
while(temp != null)
{
    lines.add(temp);
    temp = br.readLine();
}

That is if I understand what you’re asking!

Ah, that answers it! Thanks man!

Hauk