• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I/O

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi i we wanna read data frm file which stream should we use 2 read one line at a time frm source ...
thanks ..
manal
 
Trailboss
Posts: 23791
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Manal,
I'm having a tough time understanding your question. Do you wanna read a text file one line at a time?
 
manal
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ya paul ... i wanna read a text file line by line ...
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Manyways of diong it
BufferedReader buf = new BufferedReader(new FileReader(filename));
buf.readLine();
Then if u want to use streams
DataInputStream dis = new DataIunputStream(new BufferedInputStream(new FileInputStream(filename)));
dis.readLine() //note this is deprecated, so the first way s the moe preferred one
Thanks
Sanjeet

Originally posted by manal:
ya paul ... i wanna read a text file line by line ...


reply
    Bookmark Topic Watch Topic
  • New Topic