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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:00:16+00:00 2026-05-25T14:00:16+00:00

I have the flu but this is no excuse. I am going crazy over

  • 0

I have the flu but this is no excuse. I am going crazy over this (I’m sure the solution is simple). I got this input file

491 Reynosa
639 JGS-Memphis
  5 JGS-Memphis
480 Reynosa
247 JGS-Memphis
556 Reynosa
 71 JGS-Memphis
993 Reynosa
  5 JGS-Memphis
773 Reynosa
 63 JGS-Memphis
589 Reynosa
809 Reynosa
671 Reynosa
397 Reynosa
402 Reynosa
160 Reynosa
612 Reynosa
658 Reynosa
549 Reynosa
691 Reynosa
782 Reynosa
579 Reynosa

I need to do a tally but my code…

    awk -F" " '{counts[$2]=counts[$2]+1}    END     {for (key in counts)         
printf "%s\t%d\n", key, counts[key]}    ' inputfile.txt

is counting instead of summing…

JGS-Memphis 6
Reynosa 17

I want do something like this

JGS-Memphis 1030
Reynosa ...

what am I missing here??

  • 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-25T14:00:17+00:00Added an answer on May 25, 2026 at 2:00 pm
    awk -F" " '{counts[$2]=counts[$2]+$1} 
        END {for (key in counts) printf "%s\t%d\n", key, counts[key]}    ' inputfile.txt
    

    You were missing a “$”.

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

Sidebar

Related Questions

Have been scatching my head about this - and I reckon it's simple but
have written this little class, which generates a UUID every time an object of
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
Have a painfully simple blog Post creator, and I'm trying to check if the
have a nice day. I got problem when trying to create an image from
Have got a method which returns IEnumerable<User> which I have been using Linq /
Have been trying to figure this problem out for a while now and was
Have not done this before, so obviously I suck at it. Here 64 pixels
Have not done this before ( except in java , look how Steve McLeod
Have have this line of code in my form when I create a new

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.