stefanaalten
Board Regular
- Joined
- Feb 1, 2011
- Messages
- 71
- Office Version
- 365
- Platform
- Windows
I'm trying to figure out a way to accomplish the following:
I have a file ("books.csv") generated by an application (ComicRack) which lists books, one per line, unordered, approx. 4,000, as follows: Series;Title;Number;Volume;Year. A new version of this file is produced on an ad hoc basis (when I run the report). I can't change the format of the file (including the ; as field separator) as that's preset by the application.
e.g. Michel Vaillant;Paddock;58;-1;1995
I want to record the "read status" of each book by editing "books.csv", e.g. simply adding a field at the end of each line so it becomes: Series;Title;Number;Volume;Year;Read. Call this file "books-read.csv".
e.g. Michel Vaillant;Paddock;58;-1;1995;read
The list of books in books.csv may change with new books being added, removed, changed.
The only changes to books-read.csv will be when I change the "read" field, so no books will be added, removed or changed (apart from the value of the "read" field).
How can I merge these files on a regular basis?
- Books removed from books.csv should also be removed from books-read.csv, irrespective of whether they have been read or not.
- Books added to books.csv should also be added to books-read.csv, but of course the "read" field will be missing / empty
- Books changed in books.csv should overwrite the matching book in books-read.csv.
Thanks for any help with this!
I have a file ("books.csv") generated by an application (ComicRack) which lists books, one per line, unordered, approx. 4,000, as follows: Series;Title;Number;Volume;Year. A new version of this file is produced on an ad hoc basis (when I run the report). I can't change the format of the file (including the ; as field separator) as that's preset by the application.
e.g. Michel Vaillant;Paddock;58;-1;1995
I want to record the "read status" of each book by editing "books.csv", e.g. simply adding a field at the end of each line so it becomes: Series;Title;Number;Volume;Year;Read. Call this file "books-read.csv".
e.g. Michel Vaillant;Paddock;58;-1;1995;read
The list of books in books.csv may change with new books being added, removed, changed.
The only changes to books-read.csv will be when I change the "read" field, so no books will be added, removed or changed (apart from the value of the "read" field).
How can I merge these files on a regular basis?
- Books removed from books.csv should also be removed from books-read.csv, irrespective of whether they have been read or not.
- Books added to books.csv should also be added to books-read.csv, but of course the "read" field will be missing / empty
- Books changed in books.csv should overwrite the matching book in books-read.csv.
Thanks for any help with this!