Reading a text in DOS usually required the path and file name of the text file to be read. In batch processing, you can use a batch script file to read a file with a specified number of lines.
For example, if you want to read a text file named "filetxe" and read a specified number of lines from it, you can use the following code:
```
@echo off
REM stores the file path and line count in a variable
set file_path=C:\Users\user\Documents\filetxt
set line_count=10
REM reads the file and prints the number of lines
Echo reads line number:$line_count
echo
REM prints the lines to the console.
echo %file_path% : %line_count% lines
goto end
```
In this code, the file path and the number of lines are stored in a variable and then the "echo" command is used to output the number of lines. Then, he used the "goto" command to jump the code block to the "end" tag, indicating that he had finished reading the text file with the specified number of lines.
It should be noted that the value of the variable in the batch script file is executed immediately, so the "echo %file_path% : %line_count% line" command will immediately output the number of lines read. If you want to wait for the script to finish executing before you can output the number of lines, you can use the "for" command to loop through the file and use the "echo" command to output the number of lines. For example:
```
for /r %file_path% %line_count% do echo %file_path% : %line_count% line
```
This code uses the "for" command to read the specified number of lines from the specified file path and uses the "echo" command to output the number of lines.
There were many novels with female protagonists named Bing 'er. They were "Demonic Flower and Fairy Fruit","Heavenly Enchanting","Proud Bone Bing' er,""Wolf Concubine Happens: King Leng's Light Pet","World Concubine: Concubine Wan...
The reasons for the decline of historical topics were more complicated. 1. technological advancement: with the advancement of technology, it is easier for people to understand historical events through digital...
There were a total of 11 Detective Conan movies in the movie. The scenes in which Kidd appeared were: 1 Detective Conan: The Magic Enthusiast's Trap: In the first episode...
There are many good animes. Here are some recommendations: Attack on Titan 2 Naruto 3 Demon Slayer 4 Sword Art Online Your Name 6. The Attacking Elementary School Student (Barakamon)...
Nanjing Institute of Arts is a comprehensive university located in Nanjing City, Jiangsu Province. It was founded in 1952. The school has art, music, drama, dance, film and television, media,...
I recommend the book "Rebirth: Live Again" to you. This was a novel about urban life. The protagonist, Sun Dahai, was reborn in 1980. He had the technology of the...
As a fan of web novels, I don't have any emotions, and I don't fast-forward to television dramas. But I can tell you that some TV series are of very...
The title of this novel was "Ling Fei Jie", an ancient romance novel that traveled through time. The main character was called Jiang Lin, and the female lead was called...
The love story between Feng Yan and Lin Chuyue appeared in many novels. The following are some of the classic works: [1]"Battle Through the Heavens": This novel narrates the love...