Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reading files

 
Alex Johnson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey people, i am new to java and need some help..
i have a file which stores car details; owner, make, model, color, regnumber

Paul Audi A4 black MW5463
Betty RangeRover sport white MW4322
Mike Toyota hilux2.7 blue MW3421
Saun Nissan March white MW1234

the program shud accept input from keyboard and if it match any details, it outputs the line containing the detail.

i have this so far..


please help..
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

While you didn't say what is and isn't working in the code, passing an empty string as the second parameter to the StringTokenizer constructor is probably not what you want.
 
Alex Johnson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its not about the empty parameter..

i want to search the keyboard input in the file and print the line it's found..

how do i do that
 
Tarique Islam
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic