Hi
I have a txt file usually with 3 lines, either line 2 or line 3 could show "ECHO is off." like below:
T501-08680-0102
ECHO is off.
ECHO is off.
I would like to have a output txt file showing as below:
T501-08680-0102
no_sl
no_fk
Thanks
how to read from a txt file and process then write into a txt file
Moderator: DosItHelp
how to read from a txt file and process then write into a txt file
Last edited by goodywp on 26 Jan 2018 15:47, edited 1 time in total.
Re: how to read and process then write into a txt file from a text file with some strings
I guess I would go back and look at the code that was creating that file and figure out what is coded incorrectly, that is causing ECHO OFF to get output to your file.
Re: how to read and process then write into a txt file from a text file with some strings
Actually, it is due to some lines (variable) empty, originally I added into the source file. but as requirement, it is better hidden inside the code rather exposure outside
So it is correct. whenever the second or third line empty will show ECHO IS OFF.
Re: how to read from a txt file and process then write into a txt file
So what is stopping you from using a FOR /F command to read the file. Then use the IF command to see if the line equals what you are checking. Then do something based on that statement being TRUE.
You have been shown all of this in your previous questions over the past 6 months.
You have been shown all of this in your previous questions over the past 6 months.
Re: how to read from a txt file and process then write into a txt file
Could you please remove this post?Squashman wrote: ↑26 Jan 2018 16:45So what is stopping you from using a FOR /F command to read the file. Then use the IF command to see if the line equals what you are checking. Then do something based on that statement being TRUE.
You have been shown all of this in your previous questions over the past 6 months.
I had a work around to solve this issue. And I might share the issue later ....
Thanks