Add Line to txt batch
Moderator: DosItHelp
Add Line to txt batch
Hi Again;
thanx for your help for other question. it solved
i have another problem to solve.
i have txt file like
3453432432
6542312332
i need output file like that for each line
xxxxxxxx_01|3453432432
xxxxxxxx_02|6542312332
Please Help;
Regards.
CUMHUR
thanx for your help for other question. it solved
i have another problem to solve.
i have txt file like
3453432432
6542312332
i need output file like that for each line
xxxxxxxx_01|3453432432
xxxxxxxx_02|6542312332
Please Help;
Regards.
CUMHUR
Re: Add Line to txt batch
Code: Select all
@echo off
setlocal EnableDelayedExpansion
set i=100
for /F "delims=" %%a in (theFile.txt) do (
set /A i+=1
echo xxxxxxxx_!i:~-2!^|%%a
)
Re: Add Line to txt batch
Aacini wrote:Code: Select all
@echo off
setlocal EnableDelayedExpansion
set i=100
for /F "delims=" %%a in (theFile.txt) do (
set /A i+=1
echo xxxxxxxx_!i:~-2!^|%%a
)
thank you my friend.
when i use this bat it gives result in dos screen i need in txt file.
thanx for your help
regards
cumhur
Re: Add Line to txt batch
cumhur_28 wrote:when i use this bat it gives result in dos screen i need in txt file.
Remember this part of code from your last batch file.
Code: Select all
>>"newfile.txt" echo %%a
http://www.robvanderwoude.com/redirection.php
Re: Add Line to txt batch
Squashman wrote:cumhur_28 wrote:when i use this bat it gives result in dos screen i need in txt file.
Remember this part of code from your last batch file.Code: Select all
>>"newfile.txt" echo %%a
http://www.robvanderwoude.com/redirection.php
thanx for your quick reply and sorry for my english when i added end of my batch file it gives %a.
and i doing something wrong
Re: Add Line to txt batch
@echo off
setlocal EnableDelayedExpansion
set i=100
for /F "delims=" %%a in (theFile.txt) do (
set /A i+=1
echo xxxxxxxx_!i:~-2!^|%%a
)
>>"newfile.txt" echo %%a
setlocal EnableDelayedExpansion
set i=100
for /F "delims=" %%a in (theFile.txt) do (
set /A i+=1
echo xxxxxxxx_!i:~-2!^|%%a
)
>>"newfile.txt" echo %%a
Re: Add Line to txt batch
cumhur_28 wrote:>>"newfile.txt" echo xxxxxxxx_!i:~-2!^|%%a
Re: Add Line to txt batch
thanx for your help finally you did it.
this forum is the best for batch's
thanx
cumhur
this forum is the best for batch's
thanx
cumhur
Re: Add Line to txt batch
i promise this is my last question when i used this batch i will has two space end of the all lines.
how can i remove?
thanx
cumhur
Re: Add Line to txt batch
You have trailing or incorrect spaces in your batch file or in the text file.
Trim space characters problem
Hi;
i have txt files like.
each end of the line has 2 space character and some program generates and i wont reach that to change it.
i want to remove this space character.
and i want to show this file in new txt file.
pls help
thanx
cumhur
i have txt files like.
Code: Select all
xxxxxxxx_01|54545454548488
xxxxxxxx_02|89494984694964
each end of the line has 2 space character and some program generates and i wont reach that to change it.
i want to remove this space character.
and i want to show this file in new txt file.
pls help
thanx
cumhur
Re: Trim space characters problem
I am going to move this question to your previous thread because it looks to be related to your previous thread.
Re: Trim space characters problem
Squashman wrote:I am going to move this question to your previous thread because it looks to be related to your previous thread.
thank you my friend