1

I'm looking for memory efficient HTML-to-text converted similar to html2text CLI, however the problem which I've experienced is that it takes too much memory on large files.

For example it can take 3GB of memory for 300MB long HTML file (which consist only long table) so it gets killed by kernel:

Jan  9 00:42:16 kernel: Out of memory in UB 191: OOM killed process 27293 (html2text) score 0 vm:3075332kB, rss:1818104kB, swap:993020kB
Jan  9 00:42:48 kernel: Out of memory in UB 191: OOM killed process 27313 (html2text) score 0 vm:3074540kB, rss:2046032kB, swap:764368kB
Jan  9 01:07:02 kernel: Out of memory in UB 191: OOM killed process 28130 (html2text) score 0 vm:3073220kB, rss:1841448kB, swap:967648kB
Jan  9 01:07:33 kernel: Out of memory in UB 191: OOM killed process 535720 (html2text) score 0 vm:3072560kB, rss:2047284kB, swap:761080kB

Is there any alternative more efficient tool for such conversion?

1 Answer 1

2

Give a try to pandoc, a text converter.

Efficiency is related to many points (server, memory, size of original file...), so it’s difficult to answer how many ram it will use in your case.

Because it's not possible to answer a simple link, even if by nature, the answer is a link to a software here, I copy-paste the homepage:

About pandoc

If you need to convert files from one markup format into another, pandoc is your swiss-army knife. Pandoc can convert between the following formats:

HTML formats ↔ (X)HTML 4 ↔ HTML5 …

Pandoc is open-source software, maintained by volunteers working in their free time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.