• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

how can I append two files

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai
any one tell me how can i append two files in java.

but these are the steps to be done:

note: directory1 & directory2 contains same files mostly

1- read the file1 from the directory1 // it is fine for me
2- read the file2 from the directory2 // it is fine for me

3- later i need to append file2 contents to the end of the file 1. // in this part i am lost with code.

thanks
Priyan
 
author & internet detective
Posts: 41763
885
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Priyan,
Do you know how to write to a file? It's basically the same code except you pass a different boolean value for append when you create the writer.
 
Dhan Priyan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the kind reply.
i was playing with this code, but i could not understand where to give the file names.
it might help me to link the directory part with this code later.



 
reply
    Bookmark Topic Watch Topic
  • New Topic