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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:55:14+00:00 2026-05-10T22:55:14+00:00

I have a file that has one entry per line. Each line has the

  • 0

I have a file that has one entry per line. Each line has the following format:

 'group:permissions:users'  

Permissions and users could have more than one value separated by comas like this:

 'grp1:create,delete:yo,el,ella'  

I want is to return the following:

yo el ella 

This is what I have so far:

cat file | grep grp1 -w | cut -f3 -d: | cut -d ',' -f 2 

This returns yo,el.ella, How can I make it return one value per line?

  • 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. 2026-05-10T22:55:15+00:00Added an answer on May 10, 2026 at 10:55 pm

    You can use awk, with the -F option to use : as the field separator:

    [user@host]$ echo 'grp1:create,delete:yo,el,ella' | awk -F ':' '{print $3}' yo,el,ella 

    That will get you just the users string, separated by commas. Then you can do whatever you want with that string. If you want to literally print each user one per line, you could use tr to replace the commas with newlines:

    [user@host]$ echo 'grp1:create,delete:yo,el,ella' | awk -F ':' '{print $3}' | tr ',' '\n' yo el ella 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a txt plain file that has a list of numbers. One number
I have a jar file that has a file named client.ts in (when viewing
I am trying to process files one at a time that are stored over
I have an Eclipse project that I'm attempting to set up to build both
Firstly, this DB question could be a bit DB agnostic, but I am using
I'm an independent developer working primarily with iPhone applications, and I'm currently engaged in
as a side project I am working on some home-baked prime generation problems, trying
I am facing some issues while serializing objects (I am using JBoss Drools, and
I can't get this working for the life of me. Here is a snippet

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.