PDA

View Full Version : CREARE UN FIEL DI TESTO CON MOLTE RIGHE TRAMITE BAT


Splacchj
10-07-2011, 12:50
salve, mi servirebbe creare un file bat che possa scrivere un file txt con più righe di testo..
cioè se io uso il comando echo "testo che volgio scrivere" > "file.txt"
mi scrive solo uan riga.. a me servirebbe un comando che mi faccia scrivere più righe in quello stesso file.. è possibile??

3nigma666
10-07-2011, 18:43
@REM initialize test value to be "true"
@SET intCounter=1
:while
@REM test condition
@IF %intCounter% GTR 10 (GOTO wend)
@REM procedure where condition is "true"
@echo %intCounter%
@REM set new test value
@echo "testo che volgio scrivere" > "file.txt"
@SET /a intCounter=intCounter+1
@REM loop
@GOTO while
:wend

@PAUSE

pare93
16-07-2011, 09:24
Volendo potresti usare una sorta di append.

echo "Testo che vuoi scrivere" >> file.txt

Splacchj
11-08-2011, 18:49
grazie pare93 ho seguito il tuo consiglio ed ha funzionato!