M
M
mrbims2020-11-07 01:10:20
cmd/bat
mrbims, 2020-11-07 01:10:20

Why does filtering out unnecessary words from a txt file not work?

Screening out unnecessary words from a txt file and saving to another txt file
In the batch file, you need to filter out unnecessary words (there are 850 words in the list in the batch file).
The third part of the screening does not work and ends before reaching the pause

@echo off  
setlocal enableextensions enabledelayedexpansion
color 2F
SET /P base="Перетащите файл в это окно --> "
call :domain set domain
 
cls & echo Отсеиваем 1
FINDSTR /L " текст" %base% > %base%-текст1.txt
 
cls & echo Отсеиваем 2
FINDSTR /L " текст" %base% > %base%-текст2.txt

cls & echo Отсеиваем не нужные слова
FINDSTR  /L /I /P /OFF /V " слово слово1...слово850 " %base% > %base%-noСлова.txt  - не срабатывает и завершается
 
cls & echo end!
pause
exit

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hint000, 2020-11-07
@hint000

The maximum string length that can be used on the command line is 2047 characters.
https://docs.microsoft.com/en-us/troubleshoot/wind...
If you estimate, your average length of these 850 words should be less than one and a half letters , i.e. most words should consist of one letter, then it will fit into the restriction.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question