##test.txt##
First line = 1;*|:12345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345
Second line = 5;*|:3215432;*|:21543215432154321543215432154321543215432154321543215432154321543215;*|:543215;*|:5432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321543215432154321
SetLocal EnableDelayedexpansion
for /F "tokens=* delims=" %%a in ('type "test.txt"') do (
set "Line=%%a"
echo Line: "!Line!"
)
Obviously, the above code cannot read 2 lines in test.txt, since each line is over the limit(8191 characters).
By typing
type "test.txt"
It still resulted in the 2 lines as in the test.txt file. However, as soon as 2 lines get in the for loop, the lines cannot be read.
I do not need the whole length of line, so I tried to preprocess the text file, by deleting excessing part of the string. For example, limit the line length as 8100 in the above example.
1.How do I edit the above text file without using notepad(any GUI editors) in windows environment?
2.If I do not need to preprocess the file, what is the trick to avoid the above issue?
- Even I cannot put carrot(^), which extends the line of command. What I want is it is fine to split the string and take first parts, but I do not want to do it manually via notepad or other GUI file editors.