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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:40:22+00:00 2026-05-27T07:40:22+00:00

i have to process 300+ HTML files, extract a string from each one and

  • 0

i have to process 300+ HTML files, extract a string from each one and place it in a separate text file for import downstream. upside: the string format is identical in each file and is +/- two lines from the same position as well.

i thought maybe using Python, but then i thought PERL might be a better way since this kinda plays to it’s backyard.

sadly, i have no access to UNIX/LINUX or i’d just grep it…

this is such an odd client request that i’m a bit goggle-eyed ATM.

so: what is the best way to extract a target string from a BATCH of files?

WR!

  • 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-27T07:40:22+00:00Added an answer on May 27, 2026 at 7:40 am

    If you give us more details (i.e. path and name of the files, the string you want to extract, etc) perhaps I may write a Windows Batch .BAT file to achieve this task…

    EDIT

    To write a Batch file that successfully run I need a couple additional data, so I made some assumptions. You may help me to fix the details. This is my method:

    1. Seek for a line that contains “>Text link<“. I suppose there is just one; this may be fixed.
    2. Read the next line. I assumed that each td is located in independent lines; this may be fixed.
    3. In this line remove the text from beginning of line until value string.
    4. Replace quotes by $ (the next step cannot process quotes).
    5. Get the text between $; this is the result.

    for /F skip... command may read a wrong line if thefile contains empty lines; this may be fixed.

    @echo off
    setlocal DisableDelayedExpansion
    findstr /n ">Text link<" thefile.htm > linefound.tmp
    for /F "delims=:" %%a in (linefound.tmp) do set lineNo=%%a
    for /F "skip=%lineNo% delims=" %%a in (thefile.htm) do (
        set "theLine=%%a"
        goto continue
    )
    :continue
    setlocal EnableDelayedExpansion
    set theLine=!theLine:*value=!
    set theLine=!theLine:"=$!
    for /F "tokens=2 delims=$" %%a in ("!theLine!") do set URL=%%a
    echo Result: %URL%
    

    EDIT no. 2

    You are confusing me. Worked the first code or not? The second example you posted in the comments seems not be related to the first one (is the data within second <td> or after [url=http://?). Is it the same problem or a different one? Please, don’t assume I know about HTML file format (I don’t). I DO know about Batch files, but I can’t guess what to do if I have not complete details…

    The following Batch file show everything between square brackets that comes IN THE SAME LINE that have the [url=http:// string in the file given in the first parameter:

    @echo off
    for /F "tokens=2 delims=[]" %%a in ('findstr /n "[url=http://" %1') do echo %%a
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 30000 files to process each file has 80000 x 5 lines. I
I have a 100 GB text file, which is a BCP dump from a
I have Process objects that are monitored from two different views. A Windows.Forms.ListView (actually
I have 1 process that receives incoming connection from port 1000 in 1 linux
I have inherited a single project in svn: 30Gb in over 300 000 files.
I have a problem, that whenever i try to create java process from shell
I have a library consisting of some 300 c++ files. The program that consumes
I have a script partially based on the one here: Upload files with FTP
I have a file numbers.dat containing about 300 numbers(floating point,negative positive)in column format. The
Does anyone have any examples of starting the file stream before the rendering/building process

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.