Best way to get word count from docx

Hello everyone,

I need to get the word count from several docx to place them in excel.
I didn’t find a microsoft word module so I am using a multiple modules system based on google drive and google docs.
It is basically following those steps :

  1. search for the files
  2. download the file
  3. upload a gdoc version
  4. read the content
  5. delete the gdoc version
  6. [the rest (variable + add row)]

As of today, I havent find an shorter way to do this.

Does anyone have a better way to do it ?

Thanks in advance for any help :slight_smile:

Welcome to the Make community!

Yes, that is possible. You’ll need a minimum of three (or two) modules:

Screenshot_2024-10-03_191012

This is just an example. Your final solution may or may not look like this depending on your requirements.

{{length(split(replace(toString(2.data); "/\s+/g"; space); space))}}

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

Thanks for your reply.

I tried with those module but it didn’t load the content.
When I tried to set the formula to just “stripHTML(Data)”, I got this :

The file is set as readable by anyone with the link and I tried the ‘Web View Link’ in incognito browser, it’s working.

Looks like you are using a Text Aggregator to combine all the documents into file names.

You can’t do that.

My example shows you how to do it for each individual document, not after all the documents have been combined.

Delete your aggregators and try again.

If you need further assistance, please provide the following:

1. Relevant Screenshots

Please share screenshots of your scenario, any error messages, relevant module fields, and filters in question? It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:

2. Scenario Blueprint

Please export the scenario blueprint file to allow others to view the mapped variables in the module fields. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

3. Output Bundles of Modules

Please provide the output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.

A. Upload as Text File

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

B. Insert as Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

Just to let you and other people know, I came back to my previous setting : this solution is still blocked on my side and has as many module than my previous one, so it’s no improvement.

Thanks for your help anyway :slight_smile: