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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:49:33+00:00 2026-05-12T23:49:33+00:00

I have a file a.csv with contents similar to below a,b,c a ,aa, a

  • 0

I have a file a.csv with contents similar to below

a,b,c
a  ,aa,  a
a b, c, f
a , b, c
a b a b a,a,a
a,a,a
a aa ,a , t

I am trying to sort it by using sort -k1 -t, a.csv
But it is giving following results

a,a,a
a  ,aa,  a
a aa ,a , t
a b a b a,a,a
a , b, c
a,b,c
a b, c, f

Which is not the actual sort on 1st column. What am I doing wrong?

  • 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-12T23:49:33+00:00Added an answer on May 12, 2026 at 11:49 pm

    You have to specify the end position to be 1, too:

    sort -k1,1 -t, a.csv
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a CSV file which the code below uses to put the contents
I have a file which has contents on every line following this format (A,
I am trying to read a CSV file and have it display the contents
Little Background: I have csv file which has lots of rows and each row
I have a file that contains the following in a csv file; country,region,city,postalCode,metroCode,areaCode I
I have a CSV file supplied from a client which has to be parsed
I have a csv file with data looking like (see below). I need help
I have a file that I saved as a CSV file using Excel (I
I have a simple scripts to upload csv file and it works . But
I have a csv file xyz.csv with contents name,age,place,phone xyz,12,ohio,7372829 sed,23,hrh,9890908 I need to

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.