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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:23:39+00:00 2026-06-04T05:23:39+00:00

I have a parameter file which is a textfile – bug.par, which several parameters

  • 0

I have a parameter file which is a textfile – bug.par, which several parameters values listed as name of variable and its value. Just example:

par1 123 
par2 234 
par3 11 12 4 15 
par4 15
par5 18
par6 1
par7 0.05

I just want to create new files with different par5 (for exaple), say 2 additional files with par5 equal to 20, 30. Other parameters are constant.

# additional file1 with par value 20 
    par1 123 
    par2 234 
    par3 11 12 4 15 
    par4 15
    par5 20
    par6 1
    par7 0.05

# additional file1 with par value 30 
    par1 123 
    par2 234 
    par3 11 12 4 15 
    par4 15
    par5 30
    par6 1
    par7 0.05
  • 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-04T05:23:40+00:00Added an answer on June 4, 2026 at 5:23 am

    To create file1:

    sed 's/^ *\(par5\).*$/\1 20/' bug.par > file1
    

    To create file2:

    sed 's/^ *\(par5\).*$/\1 30/' bug.par > file2
    

    EDIT: As per comments, running a loop:

    # declare and initialize an array with 3 elements
    declare -a arr=(20 30 40)
    
    # iterate over array
    for i in ${arr[@]}
    do
        sed 's/^ *\(par5\).*$/\1 '$i'/' bug.par > file$i
    done
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a parameter @Department and set its value in the Dataset to =Join(Parameters!Department.Value,,)
I have an auto-generated file which looks something like this... static void do_SomeFunc1(void* parameter)
I have YAML file which needs to take a variable as an input: outputters:
I currently have a Bash completion file which completes a single parameter from a
I have NAnt script which as part of its project calls a batch file
I have an xml file which contains query details like <queries> <query> <name>GetStudentById</name> <statement>select
I have a simple .pp / puppet file, and I'm getting Parameter provider failed:
Lets say I have 10 lines in a file. I have 2 parameters that
I have a xsl file where i need to use parameters from an external
I have a function that takes 2 parameters : 1 = XML file, 2

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.