I think it's best done with an example

Contents of my file

name="apple" parameter1="value1" parameter2="value2";
name="orange" parameter1="value1" parameter2="value2";
name="tea" parameter1="value1" parameter2="value2";
name="whatever" parameter1="value1" parameter2="value2";

I want to convert apple/orange/tea/whatever to uppercase and saved it back to the same file or a new one.

Any ideas on how it can be done? Thanks


  • all contents in the file are included but at the moment there are no lines that will be exluded.
  • Also, the text "name" has no quotes around it. It is saved as written above.
  • 1
    Are there commented out versions, and should they be changed or not? Can names have quoted in them, and how? – Jeff Schaller Nov 22 '18 at 1:06
  • @JeffSchaller no comments and names have no quotes. – mrjayviper Nov 22 '18 at 1:10
awk '{q=toupper(substr($1, 6)); printf ("name=%s %s %s\n", q, $2, $3)}' filename

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.