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
+ Reply to Thread
Results 1 to 9 of 9
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.
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.
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
I'd vote for Python.
I also vote for Python.