Table of contents

At Lingohub we utilize Postgres and Elasticsearch to handle our large text base. Is there a way to do an SQL word count for our translations? There is. I wanted to share with you two SQL queries for character count and word count of a text column:


# Character count
select sum(length(YOUR_COLUMN)) from YOUR_TABLE;

# Word count
select sum(array_length(regexp_split_to_array(YOUR_COLUMN, '\s'),1)) from YOUR_TABLE;
Try lingohub 14 days for free. No credit card. No catch. Cancel anytime