Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8840397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:27:21+00:00 2026-06-14T10:27:21+00:00

I have a file with a variable declared on 7th line as VERSION=6.0.196.0. I

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:27:22+00:00Added an answer on June 14, 2026 at 10:27 am

    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

    • none of the first 15 lines in your file can be longer than 1021 bytes
    • all of the first 15 lines must be terminated with <carriageReturn><lineFeed> (Windows style), and not <lineFeed> (unix style).
    • none of the first 15 lines can end with control characters (other than line terminators of course)

    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.

    @echo off
    setlocal enableDelayedExpansion
    set "file=test.txt"
    
    REM redirect input from your file and output to a new file
    <"%file%" >"%file%.new" (
    
      REM preserve lines 1-6
      for /l %%N in (1 1 6) do (
        set "ln="
        set /p "ln="
        echo(!ln!
      )
    
      REM replace the next line (7)
      set /p "ln="
      echo VERSION=6.0.196.0
    
      REM preserve lines 8-14
      for /l %%N in (8 1 14) do (
        set "ln="
        set /p "ln="
        echo(!ln!
      )
    
      REM replace the next line (15)
      set /p "ln="
      REM The > below must be escaped
      echo MANIFEST_BUILD =^>200
    
      REM preserve the remaining lines
      findstr "^"
    
    )
    
    REM replace your original file with the new file
    >nul move /y "%file%.new" "%file%"
    

    2) This next option is much slower, but has much fewer restrictions.

    • No line can be longer than ~8191 bytes
    • No line can start with :

    Also, all lines in the output will be terminated by <carriageReturn><lineFeed>, regardless of what type of terminator the original file used.

    @echo off
    setlocal disableDelayedExpansion
    set "file=test.txt"
    
    >"%file%.new" (
      for /f "tokens=1* delims=:" %%A in ('findstr /n "^" "%file%"') do (
        if %%A==7 (
            echo VERSION=6.0.196.0
        ) else if %%A==15 (
            echo MANIFEST_BUILD =^>200
        ) else echo(%%B
      )
    )
    move /y "%file%.new" "%file%"
    

    3) This option is nearly identical to option 2, except it allows lines to begin with :. It is even slower than option 2).

    @echo off
    setlocal disableDelayedExpansion
    set "file=test.txt"
    
    >"%file%.new" (
      for /f "delims=" %%A in ('findstr /n "^" "%file%"') do (
        for /f "delims=:" %%B in ("%%A") do (
          if %%B==7 (
              echo VERSION=6.0.196.0
          ) else if %%B==15 (
              echo MANIFEST_BUILD =^>200
          ) else (
              set "ln=%%A"
              setlocal enableDelayedExpansion
              echo(!ln:*:=!
              endlocal
          )
        )
      )
    )
    move /y "%file%.new" "%file%"
    

    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

    @echo off
    set "file=test.txt"
    findstr /n "^" "%file%" | repl "^(7:.*)" "VERSION=6.0.196.0" m | repl "^(15:.*)" "MANIFEST_BUILD =>200" m | repl "^\d*:" "" m>"%file%.new"
    >nul move /y "%file%.new" "%file%"
    

    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.

    @if (@X)==(@Y) @end /* Harmless hybrid line that begins a JScript comment
    
    ::************ Documentation ***********
    :::
    :::REPL  Search  Replace  [Options  [SourceVar]]
    :::REPL  /?
    :::
    :::  Performs a global search and replace operation on each line of input from
    :::  stdin and prints the result to stdout.
    :::
    :::  Each parameter may be optionally enclosed by double quotes. The double
    :::  quotes are not considered part of the argument. The quotes are required
    :::  if the parameter contains a batch token delimiter like space, tab, comma,
    :::  semicolon. The quotes should also be used if the argument contains a
    :::  batch special character like &, |, etc. so that the special character
    :::  does not need to be escaped with ^.
    :::
    :::  If called with a single argument of /? then prints help documentation
    :::  to stdout.
    :::
    :::  Search  - By default this is a case sensitive JScript (ECMA) regular
    :::            expression expressed as a string.
    :::
    :::            JScript syntax documentation is available at
    :::            http://msdn.microsoft.com/en-us/library/ae5bf541(v=vs.80).aspx
    :::
    :::  Replace - By default this is the string to be used as a replacement for
    :::            each found search expression. Full support is provided for
    :::            substituion patterns available to the JScript replace method.
    :::            A $ literal can be escaped as $$. An empty replacement string
    :::            must be represented as "".
    :::
    :::            Replace substitution pattern syntax is documented at
    :::            http://msdn.microsoft.com/en-US/library/efy6s3e6(v=vs.80).aspx
    :::
    :::  Options - An optional string of characters used to alter the behavior
    :::            of REPL. The option characters are case insensitive, and may
    :::            appear in any order.
    :::
    :::            I - Makes the search case-insensitive.
    :::
    :::            L - The Search is treated as a string literal instead of a
    :::                regular expression. Also, all $ found in Replace are
    :::                treated as $ literals.
    :::
    :::            E - Search and Replace represent the name of environment
    :::                variables that contain the respective values. An undefined
    :::                variable is treated as an empty string.
    :::
    :::            M - Multi-line mode. The entire contents of stdin is read and
    :::                processed in one pass instead of line by line. ^ anchors
    :::                the beginning of a line and $ anchors the end of a line.
    :::
    :::            X - Enables extended substitution pattern syntax with support
    :::                for the following escape sequences:
    :::
    :::                \\     -  Backslash
    :::                \b     -  Backspace
    :::                \f     -  Formfeed
    :::                \n     -  Newline
    :::                \r     -  Carriage Return
    :::                \t     -  Horizontal Tab
    :::                \v     -  Vertical Tab
    :::                \xnn   -  Ascii (Latin 1) character expressed as 2 hex digits
    :::                \unnnn -  Unicode character expressed as 4 hex digits
    :::
    :::                Escape sequences are supported even when the L option is used.
    :::
    :::            S - The source is read from an environment variable instead of
    :::                from stdin. The name of the source environment variable is
    :::                specified in the next argument after the option string.
    :::
    
    ::************ Batch portion ***********
    @echo off
    if .%2 equ . (
      if "%~1" equ "/?" (
        findstr "^:::" "%~f0" | cscript //E:JScript //nologo "%~f0" "^:::" ""
        exit /b 0
      ) else (
        call :err "Insufficient arguments"
        exit /b 1
      )
    )
    echo(%~3|findstr /i "[^SMILEX]" >nul && (
      call :err "Invalid option(s)"
      exit /b 1
    )
    cscript //E:JScript //nologo "%~f0" %*
    exit /b 0
    
    :err
    >&2 echo ERROR: %~1. Use REPL /? to get help.
    exit /b
    
    ************* JScript portion **********/
    var env=WScript.CreateObject("WScript.Shell").Environment("Process");
    var args=WScript.Arguments;
    var search=args.Item(0);
    var replace=args.Item(1);
    var options="g";
    if (args.length>2) {
      options+=args.Item(2).toLowerCase();
    }
    var multi=(options.indexOf("m")>=0);
    var srcVar=(options.indexOf("s")>=0);
    if (srcVar) {
      options=options.replace(/s/g,"");
    }
    if (options.indexOf("e")>=0) {
      options=options.replace(/e/g,"");
      search=env(search);
      replace=env(replace);
    }
    if (options.indexOf("l")>=0) {
      options=options.replace(/l/g,"");
      search=search.replace(/([.^$*+?()[{\\|])/g,"\\$1");
      replace=replace.replace(/\$/g,"$$$$");
    }
    if (options.indexOf("x")>=0) {
      options=options.replace(/x/g,"");
      replace=replace.replace(/\\\\/g,"\\B");
      replace=replace.replace(/\\b/g,"\b");
      replace=replace.replace(/\\f/g,"\f");
      replace=replace.replace(/\\n/g,"\n");
      replace=replace.replace(/\\r/g,"\r");
      replace=replace.replace(/\\t/g,"\t");
      replace=replace.replace(/\\v/g,"\v");
      replace=replace.replace(/\\x[0-9a-fA-F]{2}|\\u[0-9a-fA-F]{4}/g,
        function($0,$1,$2){
          return String.fromCharCode(parseInt("0x"+$0.substring(2)));
        }
      );
      replace=replace.replace(/\\B/g,"\\");
    }
    var search=new RegExp(search,options);
    
    if (srcVar) {
      WScript.Stdout.Write(env(args.Item(3)).replace(search,replace));
    } else {
      while (!WScript.StdIn.AtEndOfStream) {
        if (multi) {
          WScript.Stdout.Write(WScript.StdIn.ReadAll().replace(search,replace));
        } else {
          WScript.Stdout.WriteLine(WScript.StdIn.ReadLine().replace(search,replace));
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a static variable on appDelegate declared like this: appdelegate.h file: +(NSMutableArray*)allBanco; +(void)setAllBanco:(NSMutableArray*)value;
i have a php file which stores a variable, and i need to create
I have a project where I need to reference a variable declared in one
I have a variable declared in the header file : @interface int _nPerfectSlides; and
I have declared a variable in my .xsl file. Now I want to update
In my .m file I've declared this variable static NSString* MyGlobalPassword; and in the
I have two external Javascript files. I declared a variable in one file and
I have a NSString member variable declared in the header file of the view
I have a FILE variable, declared as FILE *fin . fin = fopen( points.dat,
I have my JS file. I have a variable declared at the top called:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.