Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 08-13-2017, 03:05 AM   #1
flink
Member
flink began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Jun 2010
Device: AluraTek Libre
Question Adding metadata via filename

Hi,

I have three-part filenames: Booknumber---title---author.

Using the Test feature on the Adding Books window, I can successfully parse the filenames into Series (or Comments), Title, and Author using this:

(?P<series>.+)---(?P<title>.+)---(?P<author>[^_]+)

However, when actually importing, only the Title and Author are added to the record. The import refuses to add the booknumber in the series or comment columns. I actually wanted to get the booknumber into a custom columm, but tried existing columns to see if I was even doing it right.

I'd sure appreciate a little advice. Thanks in advance!
flink is offline   Reply With Quote
Advert
Old 08-13-2017, 05:06 AM   #2
Divingduck
Guru
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 866
Karma: 1216240
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
A series include a series name (series) and a series number (series_index). There are two possible solutions:
1. Add a series name and series index (?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)
or
2. Instead of using series create a custom field for a book number
Divingduck is offline   Reply With Quote
Old 08-15-2017, 09:57 AM   #3
flink
Member
flink began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Jun 2010
Device: AluraTek Libre
Unhappy

While that works, it wasn't my goal. My books have numbers, but no specific format. I was using Adding window as a test bed to figure out how the regex works.

I did add a custom column, but I can't get data into it from the import process.

If I haven't mis-read some other posts, I can take data from one column and stuff it into my custom column, which was why I was trying to get the data into series to comments.



Quote:
Originally Posted by Divingduck View Post
A series include a series name (series) and a series number (series_index). There are two possible solutions:
1. Add a series name and series index (?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)
or
2. Instead of using series create a custom field for a book number
flink is offline   Reply With Quote
Old 08-15-2017, 12:01 PM   #4
chaley
CC Android & calibre dev
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 8,355
Karma: 2130570
Join Date: Jan 2010
Location: France
Device: Many android devices
Use the template
Code:
(?P<series_index>.+)(?P<series>---)(?P<title>.+)---(?P<author>.*)
You end up with series as ---, series_index as the book number, etc.

Next:
  1. Select all books with series ---.
  2. Use bulk metadata edit / search/replace to copy series_index into your custom column.
  3. Press OK to run the S/R. Bulk edit will close, leaving the books selected.
  4. Open bulk edit again.
  5. On the Basic metadata panel, check the "Clear series" box.
  6. Press OK
Don't do both operations with the same "OK" because (I think) the series will be cleared first making the series_index disappear before it is copied.

EDIT: Oh, and make sure that "Read metadata from file contents rather than file name" in the "Adding books" preference screen is not checked. Otherwise your template will be ignored.

Last edited by chaley; 08-15-2017 at 12:05 PM.
chaley is offline   Reply With Quote
Old 08-15-2017, 08:02 PM   #5
Divingduck
Guru
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 866
Karma: 1216240
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
@flink, you do not mis-read. I made a mistake because I thought that custom columns are allowed and this limitation was gone some when in the past.

Please follow chaley's workflow. This is the way for solving your problem. I like to add one point. Save the two S&R so that you can use this if you need to this more than one time.

@Chales, thanks for helping.
Divingduck is offline   Reply With Quote
Advert
Old Yesterday, 07:28 AM   #6
flink
Member
flink began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Jun 2010
Device: AluraTek Libre
Hi,

I didn't have any success getting series to accept the book numbers. They are not in a distinct format. They are a mixed bag: numeric, all alpha, are alpha-num, num-alpha, and some are a mixed alphanumeric.

I couldn't get comments to accept them, either. I figured that would be a good choice, as it's free-form.

If I can get series to take the numbers and shift them where I need them I'm all set. But I can't figure it out since the test on "Adding Books" lies

Quote:
Originally Posted by Divingduck View Post
@flink, you do not mis-read. I made a mistake because I thought that custom columns are allowed and this limitation was gone some when in the past.

Please follow chaley's workflow. This is the way for solving your problem. I like to add one point. Save the two S&R so that you can use this if you need to this more than one time.

@Chales, thanks for helping.
flink is offline   Reply With Quote
Old Yesterday, 08:30 AM   #7
chaley
CC Android & calibre dev
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 8,355
Karma: 2130570
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by flink View Post
I couldn't get comments to accept them, either. I figured that would be a good choice, as it's free-form.

If I can get series to take the numbers and shift them where I need them I'm all set. But I can't figure it out since the test on "Adding Books" lies
It works fine for me.

Here is my Add Books preferences setup,
Click image for larger version

Name:	Clipboard01.jpg
Views:	16
Size:	180.3 KB
ID:	158488

Here is the file I am adding:
Click image for larger version

Name:	Clipboard02.jpg
Views:	13
Size:	17.4 KB
ID:	158489

After dragging that file onto calibre, the book list shows:
Click image for larger version

Name:	Clipboard03.jpg
Views:	12
Size:	13.1 KB
ID:	158490

And Edit Metadata shows that the comment is correctly filled in.
Click image for larger version

Name:	Clipboard04.jpg
Views:	16
Size:	92.6 KB
ID:	158491
chaley is offline   Reply With Quote
Old Today, 10:13 AM   #8
flink
Member
flink began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Jun 2010
Device: AluraTek Libre
Hi Charlie,

I had Adding Books accepting the number in either field, but couldn't get the import to accept it as metadata. I'm on 3.6.

I think I'll uninstall 3.6 and re-install it. I've just been installing on top of past versions.

Thanks for showing me it really is working the way I thought it would. I wish I knew where I was going wrong. It all seems so simple....
flink is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed- RegExp for filename to metadata when adding books jecilop Library Management 4 06-07-2016 06:46 PM
Adding tags from filename mrbongal007 Library Management 1 03-02-2015 12:54 AM
Save the Metadata to the Libary files/change filename to the Metadata RyuujiTakasu Calibre 10 03-19-2014 02:01 PM
Regular Expression - Adding metadata from filename LMF Calibre 1 03-20-2012 06:46 PM
Adding books with series in the filename genright Library Management 5 06-13-2011 03:20 PM


All times are GMT -4. The time now is 11:45 PM.


MobileRead.com is a privately owned, operated and funded community.