user
Extract the names of the characters and their associated book from the text and organize them in a table.

Input: Harry Potter was in the first book written by JK Rowling. Hermione Granger was in the second book and Ron Weasley was in the third.

Output:
assistant
Character | Book 
-------- | ---- 
Harry Potter | 1 
Hermione Granger | 2
Ron Weasley | 3