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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:33:51+00:00 2026-06-17T14:33:51+00:00

file.txt file format = cust:hdb file data = ted Ref:4rm read -p Cust: cust

  • 0
file.txt

file format  = cust:hdb

file data =   ted Ref:4rm

read -p “Cust:” cust

User key in: ted ref

grep -i -q "$cust" "file"

System able to ignore case and read the input

read -p "NewCust:" cust2

User key in: Ted Ref

awk -F : -v OFS=: -v cust=”$cust” -v cust=”$cust2″ -v hdb=”$hdb”
‘$1==cust && $2==hdb {$1=cust2;}1’ file

How do i set this so that the awk can ignore the case and update to file?

  • 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-17T14:33:53+00:00Added an answer on June 17, 2026 at 2:33 pm

    In addition to IGNORECASE, you can convert the item you are matching to lowercase in GNU awk with tolower().

    awk -F : -v OFS=: -v cust="$cust" -v cust="$cust2" -v hdb="$hdb" 'tolower($1)==cust && tolower($2)==hdb {$1=cust2;}1'
    

    The GNU awk documentation offers this page on case sensitivity.

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

Sidebar

Related Questions

I have a txt file which contains data in the following format: X1 Y1
I have some data in simplejson format in txt files, which I read using:
I am trying to copy all format file (.txt,.pdf,.doc ...) file from source folder
I have a file we will call info.txt under UNIX format that has only
If a file name is in this format assignment_number_username_filename.extension Ex. assignment_01_ssaha_homework1.txt I need to
Format: [Headword]{}UC(icl>restriction)(Attributes);(gloss) The testme.txt file has 2 lines [testme] {} acetify (V,lnk,CJNCT,AJ-V,VINT,VOO,VOO-CHNG,TMP,Vo) <H,0,0>; [newtest]
I have a file in txt-format saved on an ftp server. The server does
I have a file(both .dat and .txt format) which contains numbers(integers) in rows and
I've created a small program wich can read a .txt file. This file contains
I got a txt format like below, each user(a,b,c...) has a numeric value old

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.