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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:04:05+00:00 2026-05-15T15:04:05+00:00

$ echo a b | awk ‘{print $0; $1=1; print $0}’ a b 1

  • 0

$ echo “a b” | awk ‘{print $0; $1=”1″; print $0}’
a b
1 b

I would like to receive formatted output like this:

 a       b
 1       b

Is there easy way to do that (without IFS,OFS changes)?
I am changing columns in big table and afterwards it looks ugly.
I don’t want to reformat each column.

Thanks.

  • 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-05-15T15:04:06+00:00Added an answer on May 15, 2026 at 3:04 pm

    Probably your best bet is to post-process the output. Perhaps something as simple as:

    $ ... | awk ... | column -t
    

    will work. (Unless by “I don’t want to format each column” means “I don’t want to reformat each row”, eg “I don’t want to post process”. In which case I would ask, “Why not?”)

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

Sidebar

Related Questions

market_l=${echo $1 | awk '{print tolower($0)}'} echo $market_l when i execute this its giving
echo date(W,strtotime('2010-01-01')); This outputs 53. I would expect it to output 1. Can anyone
This command echo hello world | awk '{split($0, array, )} END{print length(array) }' does
I am trying this option #!/bin/ksh echo $1 awk '{FS==;print $2}' $1 and on
This is a very common script: #!/bin/bash teststr=col1 col2 var1=`echo ${teststr} | awk '{print
Please help this problem. I would like to assigned variable (a=echo 2012-03-16) in the
This one has me stumped. #!/bin/ksh AWKSCRIPT='END { print all done; }' OUTPUT=`echo hello
How do I make awk recognise character classes? For example, this: echo a\n1\nb\n2\nc |
Given the following command, echo "1: " | awk '/1/ -F ":" {print $1}'
echo -n 'a001~!+rr001~!+1~!+TEST DATA 1' | awk 'BEGIN {FS=~!+} {print $2}' I have the

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.