GetLines
DataTools
Description
Extract exactly the lines you need! GetLines selects specific line ranges from texts - perfect for log analysis, code reviews and data extraction. Millions of lines? No problem, you only get the relevant ones!
With a flexible line range, offset options and content filtering, you access the data with surgical precision. No more overload from huge files - only what really matters!
Why This Tool Stands Out
- Precise Line Selection - only what you need
- Log Files with Millions of Lines processed efficiently
- Content Filter - lines with specific patterns
- No Overload - minimal memory usage
Perfect for:
DevOps engineers, system administrators, developers and data analysts. Ideal for log monitoring, error analysis, code reviews, configuration checks and data samples. Perfect for server logs, application logs, configuration files and large text exports!
Workflow support; time savings depend on the task
Instead of opening huge files, scrolling and searching for lines, you extract exactly the range you need instantly - ready for analysis or further processing!
JSON Parameters
- text REQUIRED (String)The multiline text to extract lines from.
- startLine OPTIONAL (Integer)The start line (1-based). Default: 1
- endLine OPTIONAL (Integer)The end line (inclusive). Default: -1 (to the end)
- lineNumbers OPTIONAL (Array)Alternatively: array of specific line numbers [1, 5, 10, 15]
- includeLineNumbers OPTIONAL (Boolean)Whether line numbers should be included in the result. Default: false
Example Call
{
"tool": "GetLines",
"params": {
"text": "Line 1: Header\nLine 2: Data\nLine 3: More data\nLine 4: Footer",
"startLine": 2,
"endLine": 3,
"includeLineNumbers": true
}
}
Example Usage
Load the content of your log file or any multiline text.
Specify the start and end line or choose specific line numbers.
Process the extracted lines further or save them separately.
Return Values
The tool returns an object with the following properties:
- lines (Array)
Array of the extracted lines - lineCount (Integer)
Number of extracted lines - totalLines (Integer)
Total number of lines in the original text - range (String)
Description of the extracted range (e.g. "2-5") - success (Boolean)
True if the extraction was successful - error (String, optional)
Error message if the operation failed
Related DataTools
Ready for More DataTools?
Discover all our data processing tools for efficient work with logs and text files.
Explore All DataTools