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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:49:14+00:00 2026-06-05T12:49:14+00:00

Basically after I sort I want my columns to be separated by tabs. right

  • 0

Basically after I sort I want my columns to be separated by tabs. right now it is separated by two spaces. The man pages did not have anything related to output formatting (at least I didn’t notice it).

If its not possible, I guess I have to use awk to sort and print. Any better alternative?

EDIT:
To clarify the question, the location of the double spaces is not consistent. I actually have data like this:

<date>\t<user>\t<message>.

I sort by date by year, month, day and time which looks like

Wed Jan 11 23:44:30 CST 2012

and then have the output of the sorted data like the original file that is

<date>\t<user>\t<message>.

EDIT 2: Seems like my testing for tab was wrong. I was copy pasting raw line from bash to my Windows box. That’s why it didn’t recognize as a tab instead it showed spaces. I downloaded whole file to windows and now I can see that the fields are tab separated.

Also, I figured out that separation of fields (\t \n , : ;, etc) is same in the new file after sorting. That means, in the original file if I have tab separated field, my sorted file is also going to be tab separated.

One last thing, the “correct” answer was not exactly the correct solution to the problem. I don’t know if I can comment on my own thread and mark it as correct. If it is OK to do that, please let me know.

Thanks for the comments guys. Really appreciate your help!

  • 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-05T12:49:15+00:00Added an answer on June 5, 2026 at 12:49 pm

    You can use sed:

     sort data.txt  | sed 's/  /\t/g'
                             ^^
                             ||
                          2 blank spaces
    

    This will take the output of your sort operation and substitute a single tab for 2 consecutive blanks.

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

Sidebar

Related Questions

So basically after you commit something on github and change a particular file, and
I have a loop which basically calls this every few seconds (after the timeout):
I'd basically like to use reflection in Powershell, and after dynamically finding the methods
Basically I want to alter the boolean value selecting from the table: e.g.: SELECT
Basically I have some variables that I don't want to preinitialize: originalTime = None
Basically I want to run a script checking for the existence of a certain
Ok this is sort of hard to explain but basically i wrote a PHP
Looking for any pointers really. The functionality I'm after Basically I'd like to have
Or am I thinking about this wrong? Basically, I want to be able to
How to sort a list of objects for duplicates in java?basically that every object

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.