• Post Reply Bookmark Topic Watch Topic
  • New Topic

Anyone please tell me how to do this challenging job?

 
RobertChen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to java program to find all files and sub folders in a directory and if the file has "println" changed to "debug.print",
Do you understand what I mean?
It is a huge Java project, you can not change files one by one.
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This discussion thread will show you how to recursively list files in directories
http://www.javaranch.com/ubb/Forum38/HTML/000545.html
I guess what you will be doing is:
- reading in each file
- checking the file read line by line replacing occurences of "println" with "debug.println"
- writing the file out again
James.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!