View Full Version : metadata language field not after convertlit


Wimvv
12-05-2007, 09:01 AM
Hi,

In the hope that i will receive very soon a Cybook Gen3 i started experimenting with the conversion of my lit files.

I used convertlit to make opf xml files and wanted to generate mobipocket files with mobigen.exe but mobigen exists with the message that the language field is mandatory.

It seems in a lot of files i'm missing
<dc:Language>en-us</dc:Language> :p
between the <dc-metadata></dc-metadata> tags

Since i have over 300 e-books already, i find it a bit extreme to edit them book by book so my question is ... has someone already made a metadata checker who checks if the language field exists and if not, adds it ? :smack:

Cheers,
Wim

wallcraft
12-05-2007, 12:49 PM
As with all batch text processing, this would be simple under Linux.

I'm not sure if there is a standard Windows utility that could do the trick, but a Google search turned up BrineSoft Batch Text Replacer (http://brinesoft.com/BatchTextReplacer.asp). This is shareware, and from its description would do what you want.

tompe
12-05-2007, 04:31 PM
I wrote a Perl script some weeks ago that works on Unix systems but probably is easy to get to work on a Windows system. The script unpacks the lit file, fix the language tag if neccessary and there is also a variable you can set to fix totally broken HTML and incorrectly coded characters (something I had in one book). It also calls mobigen.

It is available here: http://www.ida.liu.se/~tompe/old-lit2mobi

Wimvv
12-06-2007, 04:54 AM
Thanks both :2thumbsup

Wallcraft, that search and replace tool did the trick to give me some time to assimilate compe's script into a stand-alone quick and dirty:smash: application :D