<div><br></div>I have a text file with each line in following format:<div><br></div><div>Book Name, Author Name, Genre, Publication Date</div><div><br></div><div>I would like to perform following queries on this file:</div>
<div> * Get all books written by an author</div><div><div> * Remove all books of an author</div></div><div> * Get information about a book (pretty print matching line!)</div><div> * Get books of particular genre</div><div>
<br></div><div>Also, I would like to add and delete entries in this file. I am not planning to use any database for this purpose and would like to get better grasp on file parsing and classes/OOP. I need some help in creating classes and following are my initial thoughts:</div>
<div><br></div><div># Create a class for Book object</div><div>class Book:</div><div>  atributes: name, author_name, genre, publication-date</div><div><br></div><div># Create </div><div>Author:</div><div> attribute(s): name</div>
<div><br></div><div># Create class for reading and writing to the file</div><div>class Booksfile:</div><div>  methods: ??</div><div><br></div><div><br></div><div>* How do I associate/relate Book and Author classes so that it will help me in getting information like 'get list of books written by an author'? Data attribute? </div>
<div>* Should I create a new Booksfile object for reading, writing and deleting entries in the file OR add corresponding methods to the book object itself?</div><div><br></div><div>I am not planning to use SQLite or any database and would like to use text file only. Appreciate any help on designing such application. </div>
<div><br></div><div><br></div><div><br></div><div>thanks,</div><div>N</div>