Hi ****
I have a example.txt witch contanins:
single lines can have only 1 alphanumerical value, for exampleCode:[DDRAWSINK] PlaybackDisp=0 Fullscreen=0 CurUsage=2 PlaybackRes=0 ForceRender=0 DV Output On=0 DV Preview VGA=0 DV Port=0
CurUsage can have only 2, or 3 or 0 or 9. Never 10 or -1 or 200
and this is the same for other elements (PlaybackDisp, ForceRender, DV Output On etc..)
they can only have a value between 0 and 9.
I would like change single value by a batch file, for example I need to assign to Fullscreen the "1" value instead of 0.
The batch have to recognize "Fullscreen" and change 0 ---> to 1
Is it possible? thanks
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 9 of 9
Thread
-
-
I know the modifications you described can be done with Word VBA.
I believe batch processing can also be done with Word VBA but I have never done it.
Good luck -
Assuming you know at least regular expressions you could use rxrepl to replace for example "Fullscreen=.*" with "Fullscreen=1".
In general any script and programming language can do what you want, but that would require spending some time learning.users currently on my ignore list: deadrats, Stears555 -
you have to parse lines, knowing delimiters, in your case its "=" .
Then you check for valid input.
I abandoned batch script because it is not a good choice (only for simple tasks) and for windows only, you'd be better off with other languages, but I guess now it is too late, it was us who actually perhaps brought you to this.
try:
Code:for /f "tokens=1 delims==" %%g in ('findstr /c:"PlaybackDisp" "your_text_file.ini') do SOMETHING_HERE
-
not a btach script probably a more robust programming language...
yes PERL is the first thing that comes to my mind -
you can also do those text editors like emeditor notepad++ or ultraedit then do regex searches to do text substitution across files
Similar Threads
-
batch to return the last item in a .txt file
By marcorocchini in forum Newbie / General discussionsReplies: 1Last Post: 8th Sep 2017, 18:53 -
How to find string in a large file?
By marcorocchini in forum Newbie / General discussionsReplies: 2Last Post: 26th Oct 2016, 16:38 -
how to find and replace (add a REM) a text string inside a txt file?
By marcorocchini in forum Newbie / General discussionsReplies: 1Last Post: 10th Nov 2015, 16:58 -
change Batch file to include new function
By marcorocchini in forum Newbie / General discussionsReplies: 5Last Post: 6th Jul 2014, 17:52 -
batch to extract - with ffmpeg - (initial)timecode to a .txt file
By marcorocchini in forum Newbie / General discussionsReplies: 41Last Post: 20th May 2014, 15:55