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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:13:16+00:00 2026-06-17T17:13:16+00:00

From textfile database format, Customer:HDB:Price:Left:Available Ted:rm4:34:197:101 bash shell script, read -p $’Price: ‘ Price2

  • 0

From textfile database format,

Customer:HDB:Price:Left:Available

Ted:rm4:34:197:101

bash shell script,

read -p $'Price: '  Price2
sed -i "s/$Customer:$HDB:$Price/$Customer:$HDB:$Price2/g" CustomerDB.txt

When I key in 43, database return

Ted:rm4:4334:197:101

How do i replace it to be 43 instead of 34?

  • 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-17T17:13:17+00:00Added an answer on June 17, 2026 at 5:13 pm

    Seems like $Price is empty. Are you sure it contains the old price? If you want to replace all the prices regardless of the old value, you can use

    sed -i "s/$Customer:$HDB:[0-9]*/$Customer:$HDB:$Price2/g" CustomerDB.txt
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dynamic text file that picks content from a database according to
I would like to remove all lines from a textfile which contain a certain
Does anybody know how to remove a line from a textfile. I'm looking for
I'm trying to run this script that basically reads/interprets text in from a textfile
Im trying to write the results from a SProc to a textfile. I have
I want to be able to read from a real live proper MySQL database
I need to access (read in) data repeatedly from a database in my java
I have an mnesia database dump from an ejabberd server (DCD, DCL, and DAT
I want to load the data from text file to database, if data already
I have almost 100MB of example.sql file. (Actually data export file from another database)

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.