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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:44:00+00:00 2026-06-03T09:44:00+00:00

The file which I am processing (param.txt) is tab delimited and the contents of

  • 0

The file which I am processing (param.txt) is tab delimited and the contents of the first column are _ delimited.

param.txt

ONE_one  two  three
FOUR_four  five  six
SEVEN_seven  eight  nine

I’ve created below script to process this file:

@echo off & setlocal enableextensions enabledelayedexpansion
for /f "tokens=1,2,3 delims=    " %%G in ('type param.txt') do (
  for /f "tokens=1 delims=_" %%a in ('echo %%G') do (
    echo %%a -- %%b -- %%H -- %%I
  )
)
endlocal & goto :EOF

This produces the below output:

ONE -- %b -- two -- three
FOUR -- %b -- five -- six
SEVEN -- %b -- eight -- nine

What needs to be rectified in the script to get it to print the “value” instead of %b?

  • 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-03T09:44:01+00:00Added an answer on June 3, 2026 at 9:44 am

    Try replacing tokens=1 with tokens=1,2.

    Note also that you can do the extraction with a single for loop, since you can specify multiple delimiters:

    for /f "tokens=1,2,3,4 delims=_ " %%G in ('type param.txt') do (
      echo %%G -- %%H -- %%I -- %%J
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am processing one binary file in which I want to retrieve first 4
I am processing lines of txt file which contains 4 boolean characteristics. I want
I am processing some CSV file which i have copied in Bin folder of
I've got a Perl script I'm using for running a file processing tool which
I'm processing a record-based text file: so I'm looking for a starting string which
I have created a concurrent, recursive directory traversal and file processing program, which sometimes
I am uploading a tab-delimited document and processing in the controller. Everything works fine,
So I basically have two textboxes in the aspx file which get populated by
I have a single PHP file which handles credit card processing. It starts as
I have an .exe file which takes two jpg images as arguments and makes

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.