I have a file with a variable declared on 7th line as
VERSION=6.0.196.0. I need to edit this line as VERSION=6.0.200.0
And 15th line as MANIFEST_BUILD =>196. This should be changed as MANIFEST_BUILD =>200.
How to do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
All of the solutions in this answer use only commands native to Windows XP and beyond.
1) This is by far the fastest native batch solution possible, but it has the most restrictions
<carriageReturn><lineFeed>(Windows style), and not<lineFeed>(unix style).There is one additional restriction for XP and Windows 7: The last line of the file must end with a
<lineFeed>. The script will hang indefinitely if the last line does not end with<linefeed>due to a bug in FINDSTR. See What are the undocumented features and limitations of the Windows FINDSTR command? for more info.2) This next option is much slower, but has much fewer restrictions.
:Also, all lines in the output will be terminated by
<carriageReturn><lineFeed>, regardless of what type of terminator the original file used.3) This option is nearly identical to option 2, except it allows lines to begin with
:. It is even slower than option 2).4) This last option is by far the most robust. It uses a hybrid JScript/Batch utility script that I wrote that can be used to process text files. The script still only uses commands that are native to all modern Windows platforms (XP onward).
This option is slower than option 1, but it can handle very large files in a reasonable amount of time. It is MUCH faster than options 2 and 3, which are much too slow for large files.
This option also preserves the line terminators that exist in the original file.
I’m not aware of any limitations of this option.
Here is the the script that depends on my REPL.BAT utility
And here is the REPL.BAT utility needed by the script above. REPL.BAT should be placed sowewhere in your PATH. Full documentation is embedded within the script.