This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Welcome to the JavaRanch, gagandeep. We love to talk Java, but seeing as how you are just starting out and the only way to learn how to program is by reading and writing code, we're going to ask that you do the work yourself. If you don't feel comfortable with the code you have so far, your first stop should be the Java Tutorial to pick up the basics of the language. If you understand what you have so far and just need help with the file part of the code, skip to the Input/Output part of the tutorial. Be aware that you can't just remove data from a file. You need to read in the data, alter it, then write it back out. Good luck!