• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

tokenizer

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have this file names.txt that holds names only separated by commas. I am trying to learn how to get the file use a stringtokenizer to parse it out and write to a file which doesnt exist yet called copied.txt I am able to get it to work and ouput to screen using system.out.println but i want o write it to a file. please help . here is code below i am working on thanks


Carl - I added the UBB Code Tags to make this easier to read.
[This message has been edited by Carl Trusiak (edited April 22, 2001).]
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are extremely close. While there are several ways to do this, using a PrintWriter will meet your needs with the least changes.
Change the top to

And at the bottom


------------------
Hope This Helps
Carl Trusiak, SCJP2
 
Ramesh Phankir
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks carl, have a great day
 
reply
    Bookmark Topic Watch Topic
  • New Topic