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 8118603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:32:25+00:00 2026-06-06T04:32:25+00:00

Ok, atm the script I am writing a script that pulls values from several

  • 0

Ok, atm the script I am writing a script that pulls values from several text files but can’t seem to find a good way to combine the files into a single text file.

FOR /f "tokens=%toknum% delims=:" %%G in ('"find /v /c "" "%~dp0\!systype!Win7Updates.txt""') do set maxcnt=%%G

In the text file:

KB978601,2010\MS10-019\WinSec-MS10-019-011-P57297-Windows6.1-KB978601-x86.msu,/quiet /norestart

I am trying to figure out how to create an area in a file so it will separate the stuff. I want to try and find the title, go to the title and everthing below it will be loaded.

example of what I am trying to do. (also trying to do this in CSV file) So I want the script to find the windows vista patch area and only load the ones below that area. Anyone know if that is possible?

:Windows 7 Patches
KB978601,2010\MS10-019\WinSec-MS10-019-011-P57297-Windows6.1-KB978601-x86.msu,/quiet /norestart
KB978601,2010\MS10-019\WinSec-MS10-019-011-P57297-Windows6.1-KB978601-x86.msu,/quiet /norestart
KB978601,2010\MS10-019\WinSec-MS10-019-011-P57297-Windows6.1-KB978601-x86.msu,/quiet /norestart
KB978601,2010\MS10-019\WinSec-MS10-019-011-P57297-Windows6.1-KB978601-x86.msu,/quiet /norestart
KB978601,2010\MS10-019\WinSec-MS10-019-011-P57297-Windows6.1-KB978601-x86.msu,/quiet /norestart

:Windows Vista Patches
KB978601,2010\MS10-019\WinSec-MS10-019-011-P57297-Windows6.1-KB978601-x86.msu,/quiet /norestart
KB978601,2010\MS10-019\WinSec-MS10-019-011-P57297-Windows6.1-KB978601-x86.msu,/quiet /norestart
KB978601,2010\MS10-019\WinSec-MS10-019-011-P57297-Windows6.1-KB978601-x86.msu,/quiet /norestart
KB978601,2010\MS10-019\WinSec-MS10-019-011-P57297-Windows6.1-KB978601-x86.msu,/quiet /norestart
KB978601,2010\MS10-019\WinSec-MS10-019-011-P57297-Windows6.1-KB978601-x86.msu,/quiet /norestart
  • 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-06T04:32:27+00:00Added an answer on June 6, 2026 at 4:32 am

    Your statement “everything below it will be loaded” is not clear. I assume you mean everything below the title up until the next title. I really don’t know what you mean by “loaded” – perhaps append those lines to another file? For this solution I will simply echo the lines.

    Your test case is pretty lame – the section contents are identical so it is difficult to tell if the code is working properly. Here is a more interesting test case that should be easier to interpret. I’ve added some ! characters to illustrate a problem with delayed expansion when using FOR loops.

    test.txt

    :Windows 7 patches
    Windows 7 line 1!
    Windows 7 line 2!
    Windows 7 line 3!
    
    :Windows Vista patches
    Windows Vista line 1!
    Windows Vista line 2!
    Windows Vista line 3!
    
    :Windows XP patches
    Windows XP line 1!
    Windows XP line 2!
    Windows XP line 3!
    

    Here is a batch script that will echo just the Vista patch section. It toggles delayed expansion on and off within the loop to protect the !. The expansion of %%A would not work properly if delayed expansion were on.

    @echo off
    setlocal disableDelayedExpansion
    for /f "delims=:" %%N in ('findstr /n /c:":Windows Vista patches" test.txt') do set skip=%%N
    for /f "skip=%skip% delims=" %%A in (test.txt) do (
      set ln=%%A
      setlocal enableDelayedExpansion
      if "!ln:~0,1!"==":" (endlocal & goto :break)
      endlocal
      echo %%A
    )
    :break
    

    The above solution will strip any blank lines. There are tricks to preserve blank lines if needed. It will also strip any line that begins with ; because of the default FOR /F “EOL” option. Again there are tricks available to work around this if needed.

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

Sidebar

Related Questions

I'm trying to run an ATM Simulation in C# with Windows Forms that can
I have some JavaScript that on button click takes a the text from the
atm i can successfully loading data from a WFC, read the json and put
How mature is the mono project atm? I've browsed their site but didn't find
ATM i cant quiet imagine how this will work. I'm sure it can be
I'm working on a bigger project atm, but I made this simple example to
I am into some problems atm, that is, I have a database of some
Got some code that is not mine and its producing this warning atm: iehtmlwin.cpp(264)
Say I have a GUI Java project of something that simulates an ATM machine,
this is my XML file <atm> i want to know how can i verify

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.