mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Programming (https://www.mersenneforum.org/forumdisplay.php?f=29)
-   -   Batch file problem (https://www.mersenneforum.org/showthread.php?t=23332)

pepi37 2018-05-14 09:40

Batch file problem
 
When we got factors from YOYO, I wrote small bat file to automatize project.
All goals I need is done except one: I need that line ( header with sieve depth and base ) be first, but not last ( as I get) when I start bat file
Any idea?
Thanks


[CODE]title REMOVE FACTOR
SET /P n= input base number:
sr sr_%n%.abcd -k factors.txt -g
del llr.txt
COPY *.npg all.txt
sort -n -k2 all.txt >>llr.txt
findstr /v "5000000000:P:1:%n%:257" llr.txt > BASE.txt
del llr.txt
del all.txt
echo.25000000000000:P:1:%n%:257 >>BASE.txt
rename BASE.txt BASE%n%.txt[/CODE]

kar_bon 2018-05-14 23:05

Try this:

[code]
[...]
findstr /v "5000000000:P:1:%n%:257" llr.txt >BASE.txt
del llr.txt
echo.25000000000000:P:1:%n%:257 >HEAD.txt
copy /B HEAD.TXT+BASE.TXT BASE%n%.txt
del HEAD.txt BASE.txt
[/code]

pepi37 2018-05-15 09:02

[QUOTE=kar_bon;487613]Try this:

[code]
[...]
findstr /v "5000000000:P:1:%n%:257" llr.txt >BASE.txt
del llr.txt
echo.25000000000000:P:1:%n%:257 >HEAD.txt
copy /B HEAD.TXT+BASE.TXT BASE%n%.txt
del HEAD.txt BASE.txt
[/code][/QUOTE]


THANKS!
Working well now!


All times are UTC. The time now is 19:31.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.