text_collector

Extract text from files and directories with encoding detection and metadata options.

541|171|Updated May 3, 2018
One-click install
npx skills add https://github.com/cas-bigdatalab/piflow --skill text-collector
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: text_collector
Source: https://github.com/cas-bigdatalab/piflow/tree/main/workspace/skills/text_collector
Command: npx skills add https://github.com/cas-bigdatalab/piflow --skill text-collector

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill streamlines the process of collecting and structuring text data from various file types and directories, providing a quick and efficient solution for managing textual information.

Core Features & Use Cases

  • Text Collection: Gather text content from .txt, .md, .rst, .log, and .text files.
  • Directory Handling: Collect text from a directory, with options for recursive processing.
  • File Encoding: Auto-detect or specify file encoding for accurate content extraction.
  • Metadata Addition: Optionally include file metadata in the output for better record-keeping.
  • Output Format: Export collected text in JSONL, JSON, CSV, or auto-detected format.
  • Use Case: Ideal for data journalists, researchers, or anyone needing to collect and organize large text datasets from multiple sources.

Quick Start

Use the text_collector skill to collect text from the 'input_folder' directory and output to 'output_file.jsonl'.

Frequently Asked Questions about text_collector

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract text content from multiple files in a directory using Python?

You can extract text content from multiple files by targeting a directory, enabling recursive scanning to process nested files, and supporting formats like .txt, .md, .rst, .log, and .text.

What is the best way to collect text data from files with unknown encodings?

The best way to collect text data with unknown encodings is using auto-detection features that identify file encodings for accurate content extraction without manual specification.

Can I include file metadata when collecting text for data journalism research?

Yes, you can include file metadata when collecting text for data journalism research by enabling a metadata addition option to attach file details to the output for better record-keeping.

What output formats are supported when exporting collected text datasets?

Supported output formats for exporting collected text datasets include JSONL, JSON, CSV, and auto-detected formats, allowing flexible integration with downstream data preprocessing pipelines.

Does text collection from directories support recursive file processing?

Yes, text collection from directories supports recursive file processing, allowing you to scan nested subdirectories and gather text content from all compatible files within the folder structure.

Why does auto-detecting file encoding matter for research automation text preprocessing?

Auto-detecting file encoding matters for research automation because it prevents character corruption and data loss, ensuring accurate text extraction across files saved with different encoding standards.