windows - Batch for insert/replace in a txt file in a fixed position -
I need to replace a batch file (.bat), using an empty character, 13) from each line In a .txt file, with another set character.
Example of My File:
1000588141025 00LEOTOURING SRL VIA FILADELFO CASTRO, 1 LENTINI
I have to:
1000588141025A00LEOTOURING SRL VIA FILADELFO CASTRO, 1 LENTINI
@ECHO OFF :: Version 1 -" Replace interconnected "SETLOCAL ENABLEDELAYEDEXPANSION (FOR / f" delims = "%% a IN (q26733113.txt) DO (SET" Line =% % A "ECHO (Line: ~ 0,13! A! Line: ~ 14!)) Gt; New File. Txt :: Version 2 -" Can be found only in the status, change only if "SETLOCAL ENABLEDELAYEDEXPANSION (FOR / F "Delims =" %% an IN (q26733113.txt) DO (SET "line) = %% an "IF"! Line: ~ 13,1! "==" "(ECO (Line: ~ 0,13! A! Line: ~ 14!) ELSE (ECHO (%% A)) gt ; Newfile2.txt GOTO: EOF
I used a file named q26733113 .txt
is adding your data to my test.production < Code> newfile.txt and newfile 2.txt
- Changing columns for the first time - well 14 in the normal 14th, as shown in your test data - whether column 14 Regardless of the content. Second only <14> code if it was a place, otherwise it is left.
Do not worry about anticipated unbalanced brackets. echo (
has special properties - the parenthesis is not calculated ...
Comments
Post a Comment