• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help to Make my code Generic  RSS feed

 
Njk Naresh
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

I wrote a simple code to read text file and write it to an html file. Now, i want to enhance it and make it generic. I need your inputs to make changes. Below is the code




Below is my input file:

Testing
CustomerName is xyz
Logged in users are Rama
*************************

Testing
CustomerName is abc
Logged in users are
*************************

Testing
CustomerName is xyz
Logged in users are Krishna
*************************

Thanks in advance

 
Stephan van Hulst
Saloon Keeper
Posts: 7993
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you think code would be enhanced by making it generic? Do you have certain use cases in mind?

I think your code could benefit much more from cutting it up in multiple methods, using proper exception handling, try-with-resources, and possibly using a library that can format HTML or XML.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!