Actions132
- AI Actions
- Extract Text From Document
- Check Content Policy
- Detect Adult Content
- Detect Brand
- Detect Color
- Detect Email Type
- Detect Faces
- Extract Entities
- Extract Contact Information
- Extract Customizable Information From Text
- Fuzzy Text Matcher
- Generate Image
- Generate JavaScript Code
- Generate Python Code
- Detect Language
- Detect Mood
- Extract Text From PDF
- Recognize Objects in Image
- Extract Text From Image
- Redact Sensitive Information From PDF
- Remove Background Image
- Summarize Text
- Transcribe
- Translate Text
- Image Actions
- Business Actions
- Convert Actions
- Generate Actions
- Crypto Actions
- Operator Actions
- Storage Actions
- Scheduler Actions
- Text Actions
- Chart Actions
- Code Actions
- Calculate Actions
- Date and Time Actions
- PDF Actions
- Compress PDF File
- Count PDF Pages
- Create Empty PDF
- Decrypt PDF
- Convert DOCX to PDF
- Draw Image on PDF
- Draw Text on PDF
- Encrypt PDF
- Convert HTML to PDF
- Convert Markdown to PDF
- Manage PDF Metadata
- Merge PDF Files
- Add PDF Pages
- Remove PDF Pages
- Resize PDF Pages
- Rotate PDF Pages
- Convert PDF to Base64
- Convert PDF to Image
- Split PDF File
- Add Image Watermark to PDF
- Add Text Watermark to PDF
- Shortened URL Actions
Text → Text Extractor
AI-generatedOverview
The "Text Extractor" operation in the Text resource provides a utility to extract a substring from a given base string. It extracts text that lies between a specified start pattern and an end pattern. This is useful for parsing structured or semi-structured text data where you want to isolate specific information embedded within larger text blocks.
Common scenarios include:
- Extracting values from logs, emails, or reports where data is enclosed between known delimiters.
- Parsing user input or scraped web content to retrieve relevant segments.
- Automating data extraction tasks without writing custom code.
For example, if you have a string like "Name: John Doe\nAge: 30", you can extract the name by setting the start pattern to "Name: " and the end pattern to "\n".
Properties
| Name | Meaning |
|---|---|
| Start Pattern | The string that marks the beginning of the text to extract. |
| End Pattern | The string that marks the end of the text to extract. |
| Base String | The full string from which the extraction will be performed. |
| Greedy | Whether to extract the last match (true) or the first match (false) when multiple matches exist. |
| Case Sensitive | Whether the matching should consider case differences (true) or ignore them (false). |
| Return Error if Not Found | Whether the node should throw an error if no matching text is found (true) or continue silently (false). |
Output
The output contains a JSON field with the extracted substring(s) based on the provided patterns. If the extraction is successful, the output JSON will include the matched text segment(s).
If binary data were involved (not applicable here), it would typically represent files or images, but this node only deals with textual data extraction.
Dependencies
- Requires an API key credential to authenticate requests against the external service at
https://prod.0codekit.com. - The node sends a POST request to
/text/extractorendpoint with parameters including start pattern, end pattern, base string, and greedy flag. - No additional environment variables are required beyond the API key credential.
Troubleshooting
- No match found: If the start or end pattern does not exist in the base string, the output will be empty unless "Return Error if Not Found" is enabled, in which case the node throws an error.
- Case sensitivity issues: If extraction fails unexpectedly, verify whether the "Case Sensitive" option is set correctly according to your input text.
- Multiple matches: By default, the node extracts the first match. Enable "Greedy" to extract the last match instead.
- Invalid patterns: Ensure that the start and end patterns are correct and do not contain unintended characters or escape sequences.
- API errors: Check that the API key credential is valid and has proper permissions. Network issues or service downtime may cause failures.
Links and References
- 0CodeKit API Documentation (for general API reference)
- n8n Documentation on Creating Custom Nodes
- General guide on Text Extraction Techniques