> For the complete documentation index, see [llms.txt](https://hiimmaxx7s-organization.gitbook.io/gpm-automate/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hiimmaxx7s-organization.gitbook.io/gpm-automate/no-code-automation/variables/count.md).

# Count

Có thể dụng khi đếm số dòng của 1 file text, hay dùng để lấy số lượng file khi dùng action Folder get file list.

## Ví dụ cho action Count

1. Đếm số lượng dòng trong file text. Dùng 2 action là File read all lines và Count như hình dưới.<br>

   <figure><img src="/files/GvFE3Tf4ulT03Z8Sdsts" alt=""><figcaption><p>File read all lines</p></figcaption></figure>

   <figure><img src="/files/heES3wd4jz9KagGIs65L" alt=""><figcaption><p>Count</p></figcaption></figure>
2. Đếm số lượng file trong 1 folder khi dùng action Folder get file list.<br>

   <figure><img src="/files/V6RLrJS4kbO8oYkkdHYS" alt=""><figcaption><p>Folder get file list</p></figcaption></figure>

   <figure><img src="/files/5s5a9g0P7QcKMTVdc1KC" alt=""><figcaption><p>Count</p></figcaption></figure>
3. Đếm số phần tử trong danh sách sau khi tách chuỗi bằng Split text.

Ví dụ: Có 1 chuỗi đầu vào là `hello|my|name|is|GPM|Automate`

<figure><img src="/files/ohCxKOBzBUCvAw0AXKNq" alt=""><figcaption><p>Split text</p></figcaption></figure>

<figure><img src="/files/LWGJg6bk6HT8egRGFxJ8" alt=""><figcaption><p>Count</p></figcaption></figure>

Chuỗi được ngăn cách bởi dấu |. Sau khi dùng action Split text, biến count sẽ đếm được số phần tử sau khi tách chuỗi (như ở ví dụ trên thì count sẽ có giá trị là 6).
