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

  • SEARCH
  • Home
  • 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 275993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:51:03+00:00 2026-05-12T00:51:03+00:00

I posted another one on this,, but i had to edit it really much…

  • 0

I posted another one on this,, but i had to edit it really much…

What the thing bassicly is that a Batch (Maybe including VBScript) can find line 29 in a txtfile… it should edit this line.

If line 29 is like this: ‘option=21’ it should change it to ‘option=22’

the problem is that this line is located more in the file. so it should just edit line 29…

How-to???

[please no custom programs;;; it should be done by every user without installing something OK.]

  • 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-05-12T00:51:03+00:00Added an answer on May 12, 2026 at 12:51 am

    This isn’t something you’re usually doing in batch, but it’s fairly straightforward:

    @echo off
    setlocal enableextensions enabledelayedexpansion
    
    rem the input file
    set inputfile=file.txt
    
    rem temporary file for output, we can't just write into the
    rem same file we're reading
    set tempfile=%random%-%random%.tmp
    
    rem delete the temporary file if it's already there
    rem shouldn't really happen, but just in case ...
    copy /y nul %tempfile%
    
    rem line counter
    set line=0
    
    rem loop through the file
    for /f "delims=" %%l in (%inputfile%) do (
        set /a line+=1
        if !line!==29 (
            rem hardcoded, at the moment, you might want to look
            rem here whether the line really starts with "options"
            rem and just put another number at the end.
            echo option=22>>%tempfile%
        ) else (
            echo %%l>>%tempfile%
        )
    )
    
    del %inputfile%
    ren %tempfile% %inputfile%
    
    endlocal
    

    It should point you into the general direction if you want to adapt it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i posted another question about this, but i think this one will be more
I posted this over at reddit but it didn't gain any momentum. So here
I posted this question here before but there were no responses. I may have
In another question I posted yesterday, I got very good advice on how a
Someone posted a great little function here the other day that separated the full
I posted this question yesterday evening, which has led me to discover a huge
I posted this question: https://stackoverflow.com/questions/418597/java-and-net-for-php-programmer and the answers I was given didn't really help
Note: This was posted when I was starting out C#. With 2014 knowledge, I
This is re-posted from something I posted on the DDD Yahoo! group. All things
EDIT: I figured out the answer to the original YUI3 question I posted here,

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.