I have the following requirement. Would appreciate if you'll can give your best suggestions.
I want to load a path to a folder (D:\MyFolder\MyApp)using properties , i guess that i can do with Properties load method.
after loading the path D:\MyFolder\MyApp , there are 20 .db2 files , I need to dynamically append the name of the db2 file from a .csv file which is a comma seperated file to the above path. I need to get the name of the .db2 file one by one [This is where i am confused]from the csv and append it to the path i.e D:\MyFolder\MyApp\sm_sb_ac_af.db2
Once this is done , I need to byte by byte read that file and make a new file with the same name in other path which would be something like D:\MyFolder\MyApp\MyDestination\*.db2 , The new file would contain the new changes which i want.
Now the need :
The following is needed because the old .db2 file contains db2 comments i.e (--) , my java program should be able to open the old db2 file , remove all the occurances of "--" and add some custom lines like "IN" once the defination of CREATE TABLE ends.
Can someone let me know what is the best way to achieve it.
Any and all suggestions and input(s) are highly appreciated.
Thanks and Regards, Yogendra N Joshi.
Meri Zindagi Hain Tab Tak.. Jab Tak Tera Sahara.... Har Taraf Tu Hi Tu Hain SAI Tera Hi Hain Nazara.....
I'm not sure I understand exactly what you're having trouble with, but I hope this will be useful.
Look at class java.io.File. It contains methods to list the files in a directory. If you have a File object which represents the directory, you can call list() or listFiles() on it to get an array of File objects that represent the files (and subdirectories) in the directory. If you only want to see the files that end in ".db2", then you can pass a FilenameFilter to the listFiles() method, for example: