mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-23 08:16:17 -04:00
Add Head and Tail operations
This commit is contained in:
parent
07bb095e73
commit
dea214bd2e
3 changed files with 338 additions and 1 deletions
|
@ -3196,7 +3196,69 @@ const OperationConfig = {
|
|||
outputType: "html",
|
||||
args: [
|
||||
]
|
||||
}
|
||||
},
|
||||
"Head": {
|
||||
description: [
|
||||
"Like the UNIX head utility.",
|
||||
"<br>",
|
||||
"Gets the first $Number of lines.",
|
||||
"<br>",
|
||||
"Optionally you can select all but the last $Number of lines.",
|
||||
"<br>",
|
||||
"The delimiter can be changed so that instead of lines, fields (i.e. commas) are selected instead.",
|
||||
].join("\n"),
|
||||
run: StrUtils.runHead,
|
||||
inputType: "string",
|
||||
outputType: "string",
|
||||
args: [
|
||||
{
|
||||
name: "Delimiter",
|
||||
type: "option",
|
||||
value: StrUtils.DELIMITER_OPTIONS
|
||||
},
|
||||
{
|
||||
name: "Number",
|
||||
type: "number",
|
||||
value: 10,
|
||||
},
|
||||
{
|
||||
name: "All but last $Number of lines",
|
||||
type: "boolean",
|
||||
value: false,
|
||||
},
|
||||
]
|
||||
},
|
||||
"Tail": {
|
||||
description: [
|
||||
"Like the UNIX tail utility.",
|
||||
"<br>",
|
||||
"Gets the last $Number of lines.",
|
||||
"<br>",
|
||||
"Optionally you can select all lines after line $Number.",
|
||||
"<br>",
|
||||
"The delimiter can be changed so that instead of lines, fields (i.e. commas) are selected instead.",
|
||||
].join("\n"),
|
||||
run: StrUtils.runTail,
|
||||
inputType: "string",
|
||||
outputType: "string",
|
||||
args: [
|
||||
{
|
||||
name: "Delimiter",
|
||||
type: "option",
|
||||
value: StrUtils.DELIMITER_OPTIONS
|
||||
},
|
||||
{
|
||||
name: "Number",
|
||||
type: "number",
|
||||
value: 10,
|
||||
},
|
||||
{
|
||||
name: "Start from line $Number",
|
||||
type: "boolean",
|
||||
value: false,
|
||||
},
|
||||
]
|
||||
},
|
||||
};
|
||||
|
||||
export default OperationConfig;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue