I try to write a script which takes in params:
- range of line
- range of column
For ex: cmd filename 1 5 12 87
where 1 and 5 it’s range of line
and 12 and 87 range of column
I want to extract text from these ranges.
I find something for line using head and tail but I have no idea on how i can select the corresponding columns.
Only for windows: batch, powershell.
UPDATE 1
file.txt
define('HTTP_REQUEST_METHOD_GET', 'GET', true);
define('HTTP_REQUEST_METHOD_HEAD', 'HEAD', true);
define('HTTP_REQUEST_METHOD_POST', 'POST', true);
define('HTTP_REQUEST_METHOD_PUT', 'PUT', true);
define('HTTP_REQUEST_METHOD_DELETE', 'DELETE', true);
define('HTTP_REQUEST_METHOD_OPTIONS', 'OPTIONS', true);
define('HTTP_REQUEST_METHOD_TRACE', 'TRACE', true);
cmd file.txt 1 3 19 27
output:
ST_METHOD_GET', 'GET', true);
define('HTTP_REQUEST_METHOD_HEAD', 'HEAD', true);
define('HTTP_REQUEST_METHO
I add blank a first line just for better representation.
I fact the script simulate the selection of the text from line X to line Y starting at column W (just for the first line) and eding at column Z (just for the last line)
Try this:
I understand that columns and lines values are included values.
After your more accurate sample try this: