ZTree.com  | ZEN  | About...  

 Index   Back

[General] is there a way to append two lines to many text files?   [General]

By: GoSlow2GoFast     RI  
Date: Jan 08,2022 at 18:24
In Response to: [General] is there a way to append two lines to many text files? (Ryan)

> is there a way to insert or append or add these two lines to about
> 200 batches?
>
> SET K0="..\pathdata.TXT"
> FOR /F "Tokens=*" %%V IN ('TYPE %K0%') DO (SET K1=%%V)
>
> the combination of the string replacer and #zttag has been working so
> well except for the quotation mark "" replacements. but adding lines
> are my limit.
>
>
> or is there a way to replace @echo off with three lines
> @echo off
> SET K0="..\pathdata.TXT"
> FOR /F "Tokens=*" %%V IN ('TYPE %K0%') DO (SET K1=%%V)
>
> any utilities that can do this with #zttag?

If you want to append the new lines to the existing files, just do an ECHO with redirection (append).

Something like:

for %%A in ("*.txt") do (
echo SET K0="..\pathdata.TXT">>"%%~A"
echo FOR /F "Tokens=*" %%V IN ('TYPE %K0%') DO (SET K1=%%V)>>"%%~A"
)

642 views      
 

Messages in this Thread

 
96,664 Postings in 12,235 Threads, 350 registered users, 161 users online (0 registered, 161 guests)
Index | Admin contact |   Forum Time: Jun 16, 2024 - 4:11 pm UTC  |  Hits:64,855,405  (65,465 Today )
RSS Feed