0

I am trying to duplicate a csv file but rename the duplicated file with a new extension of txt during runtime so it can be used for another method. Can this be done?

lhoops
  • 11
  • 2
  • You don't need java for this. You can use `cp a.csv b.txt`. – Deepak Patankar Jan 01 '20 at 17:03
  • @DeepakPatankar I am using windows. Also I would like to do this during runtime so the text file can be used in another method. I have edited the question. – lhoops Jan 01 '20 at 17:06
  • please post what you have tried? – lakshman Jan 01 '20 at 17:07
  • 1
    Yes, it can be done. https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#copy-java.nio.file.Path-java.nio.file.Path-java.nio.file.CopyOption...- – JB Nizet Jan 01 '20 at 17:11
  • Does this answer your question? [Copy and rename file on different location](https://stackoverflow.com/questions/5388146/copy-and-rename-file-on-different-location) – kasptom Jan 01 '20 at 17:17
  • 1
    @kasptom yes sorry my bad I have only come across this question now. Thanks for your help! – lhoops Jan 01 '20 at 17:27

0 Answers0