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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:25:32+00:00 2026-05-18T23:25:32+00:00

Greetings. I need to generate a simple report via Bash (Korn?) with this raw

  • 0

Greetings.

I need to generate a simple report via Bash (Korn?) with this raw data

Test_Version=V2.5.2
Test_Version=V2.6.3
Test_Version=V2.4.7
Test_Version=V2.5.2
Test_Version=V2.5.2
Test_Version=V2.5.1
Test_Version=V2.5.0
Test_Version=V2.3.9
Test_Version=V2.3.1

Ideally, I’d like to get something like this sorted output

Version    Count
...
V2.5.0     1
V2.5.1     1
V2.5.2     3
V2.6.3     1
...

I can sort the output like this (raw data is contained in ASCII files):

find . -name "*.VER" -exec grep "Test_Version" '{}' ';' -print | grep -e "Test_Version" | sort -u

But I can’t figure out how to count my records in a tabular layout. Any idea how could I do that?

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

    This seems like a job for awk:

    Assuming your version information is in the file versions.txt (you can also not specify a filename, in that case awk reads from stdin).

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

    Explanation:

    • -F= tells awk to use the = character as field separator. Each line in your data will be treated as two fields of which only the second is used.
    • The first statement between braces is executed for each line of input. Keeping count for each occurence of the second field, which is $2.
    • The second statement in braces preceded by the keyword END is executed after the last line is processed. It shows all the counts for all distinct values of $2.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings, Here is my problem. I need to get data from multiple rows and
Greetings, I need a way (either via C# or in a .bat file) to
Greetings, I have three TS variables resembling something like the following: data <- read.csv(...)
greetings all I need the sub-domains to be something like: sub1 (letters or digits)
Greetings all. I need to get some opinions from those outside of my work
Greetings. Need some assistance with creating a computed column on this table: USE [ScienceWorksSummary]
Greetings, I need to port this Windows utility: http://solinker.com to Mac. The app was
Greetings, I am working with a FatWire CS, and need to incorporate Web services.
Greetings good people - I need some help. I have until now buildt web-pages
Greetings, I hope someone has the patience to read this. I have a setup

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.