Categories

Array Extractor

Extract elements of specific types from arrays (numbers, strings, booleans, objects, etc.)

Key Facts

Category
Data Processing
Input Types
textarea, select, checkbox, text
Output Type
text
Sample Coverage
4
API Ready
Yes

Overview

The Array Extractor is a versatile utility designed to quickly isolate specific data types from mixed-content arrays. Whether you are cleaning messy datasets or filtering raw inputs, this tool allows you to extract integers, floats, strings, or booleans with precision and ease.

When to Use

  • When you need to separate numerical values from a mixed list of strings and numbers.
  • When cleaning raw data inputs that contain unwanted null or undefined values.
  • When you need to standardize a list of strings by trimming whitespace and filtering by type.

How It Works

  • Paste your data into the input field as a JSON array, comma-separated values, or one item per line.
  • Select the specific data type you wish to extract from the dropdown menu.
  • Toggle optional settings like 'Include Null Values' or 'Trim Whitespace' to refine the output.
  • Click the process button to generate a clean, filtered list of your desired elements.

Use Cases

Extracting only numerical IDs from a mixed log file containing text and numbers.
Cleaning a user-submitted form list by removing all null and undefined entries.
Isolating boolean flags from a complex configuration object array.

Examples

1. Cleaning Log Data

Data Analyst
Background
A log file contains a mix of timestamps, error codes, and status messages in a single array.
Problem
Need to isolate only the numerical error codes for statistical analysis.
How to Use
Paste the log array, select 'Integers' as the extract type, and click process.
Outcome
A clean list containing only the integer error codes, ready for import into a spreadsheet.

2. Form Input Sanitization

Web Developer
Background
A user submitted a form resulting in an array containing empty strings, null values, and valid text.
Problem
Need to remove nulls and trim whitespace to prepare the data for a database.
How to Use
Paste the array, select 'Strings', ensure 'Include Null Values' is unchecked, and enable 'Trim Whitespace'.
Outcome
A sanitized array of strings with all empty or invalid entries removed.

Try with Samples

text, barcode

Related Hubs

FAQ

What input formats are supported?

The tool accepts standard JSON arrays, comma-separated values, or lists where each item is on a new line.

Can I extract multiple types at once?

No, the tool is designed to extract one specific data type per operation to ensure accuracy.

How does the tool handle whitespace in strings?

You can enable the 'Trim Whitespace' option to automatically remove leading and trailing spaces from extracted strings.

Does it support custom separators?

Yes, you can define a custom separator if your input data uses a specific character other than commas or newlines.

Are my inputs saved on your server?

No, all processing is performed locally in your browser, ensuring your data remains private.

API Documentation

Request Endpoint

POST /en/api/tools/array-extractor

Request Parameters

Parameter Name Type Required Description
inputArray textarea Yes -
extractType select Yes -
includeNull checkbox No -
includeUndefined checkbox No -
caseSensitive checkbox No -
trimWhitespace checkbox No -
customSeparator text No -

Response Format

{
  "result": "Processed text content",
  "error": "Error message (optional)",
  "message": "Notification message (optional)",
  "metadata": {
    "key": "value"
  }
}
Text: Text

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-array-extractor": {
      "name": "array-extractor",
      "description": "Extract elements of specific types from arrays (numbers, strings, booleans, objects, etc.)",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=array-extractor",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]