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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:18:58+00:00 2026-06-07T19:18:58+00:00

Delimited by comma using AWK or SED with the tags used below: [BEGIN AccountID]

  • 0

Delimited by comma using AWK or SED with the tags used below:

[BEGIN AccountID]
        [BEGIN CallerID]
            [BEGIN Billed Account Attributes]
            1111111
            1111111
            1111111
            [END Billed Account Attributes]

        [BEGIN OBIO Tax]
        10
        20
        30
        [END OBIO Tax]

        [BEGIN RINO Tax]
        777
        888
        999
        [END RINO Tax]
    [BEGIN CallerID]
[END AccountID]


[BEGIN AccountID]
    [BEGIN CallerID]
        [BEGIN Billed Account Attributes]
        2222222
        2222222
        2222222
        [END Billed Account Attributes]

        [BEGIN OBIO Tax]
        40
        50
        60
        [END OBIO Tax]

    [BEGIN CallerID]
[END AccountID]

I want a AWK or SED script to print this:

1111111,1111111,1111111,  10,20,30,  777,888,999

2222222,2222222,2222222,  40,50,60,    0,  0,  0
....
....
....

Delimited by comma and put ZERO when RINO TAX is not displayed.

Thanks so much!!!!

  • 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-07T19:19:00+00:00Added an answer on June 7, 2026 at 7:19 pm

    This might work for you (GNU sed):

    sed '/\[BEGIN AccountID\]/,/\[END AccountID\]/!d;/\[BEGIN AccountID\]/{h;d};/./H;/\[END AccountID\]/!d;g;s/\n*\[[^\n]*\n*//g;s/\n/,/g;s/\s*//g;ta;:a;s/,//9;t;s/$/0,0,0/' file
    

    N.B. This removes spaces and blank lines.

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

Sidebar

Related Questions

I am importing csv to db using bulk insert. It is the comma delimited
I am parsing a comma delimited set of data using LINQ. Within the LINQ
I am using jQuery to bring in a string of comma-delimited numbers for plotting
I'm using fputcsv in PHP to output a comma-delimited file of a database query.
I am using C#, I have a comma delimited csv file with different strings
I cannot seem to get a [comma-]delimited string out of an XML doc using
I'm using Spring 3.0.5. I've got a comma delimited string A, B, C, D.
I am using the following regular expression to validate a comma delimited list of
How do I remove duplicates from a comma delimited string of integers using jquery/javascript?
I have a comma delimited list of ids that I want to use 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.