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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:44:34+00:00 2026-05-16T21:44:34+00:00

I have the following input file that you might recognize as a debian Packages

  • 0

I have the following input file that you might recognize as a debian Packages file:

Package: nimbox-apexer-sales
Version: 1.0.0-201007241449
Architecture: i386
Maintainer: Ricardo Marimon <rmarimon@nimbox.com>
Installed-Size: 124
Depends: nimbox-apexer-root
Filename: binary/nimbox-apexer-sales_1.0.0-201007241449_i386.deb
Size: 68880
MD5sum: c4538f2913d76b57110ba73d0b87cc16
Section: base
Priority: optional
Description: Sales Application for NiMbox.

Package: nimbox-tomcat
Version: 6.0.26-5
Architecture: i386
Maintainer: Ricardo Marimon <rmarimon@nimbox.com>
Installed-Size: 6144
Depends: sun-java6-jdk
Filename: binary/nimbox-tomcat_6.0.26-5_i386.deb
Size: 5490024
MD5sum: 5f2ccbe6137af2842e1c81bc217444e3
Section: base
Priority: optional
Description: Tomcat Servlet Application Server for NiMbox
 NiMbox requires a servlet application server in order to work.  The current
 NiMbox implementation requires a Tomcat Servlet Application.

The file actually has many of these entries and I want to get the following file

nimbox-apexer-sales 1.0.0-201007241449
nimbox-tomcat 6.0.26-5

Where the Package and the Version are separated by a tab so that I can later use cut to get them. I’m pretty sure this can be done with sed. I went over the sed one liners but this is probably a bit more complex. Any ideas?

  • 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-16T21:44:34+00:00Added an answer on May 16, 2026 at 9:44 pm

    When working with Debian Packages files, you might find grep-dctrl
    useful. It’s incredibly flexible in both the ways it allows to limit the data it
    outputs, as well as in how to output it. Instead of trying to parse the Packages
    file format myself, I’d just ask grep-dctrl to do it for me, and print only
    the bits if information I’m actually interested in:

    $ grep-dctrl -n -s Package,Version nimbox /var/lib/apt/lists/..._Packages
    

    That would give you something like:

    nimbox-apexer-sales
    1.0.0-201007241449
    
    nimbox-tomcat
    6.0.26-5
    

    With that, it’s only a matter of joining the right lines together, which is easy
    enough with, for example, perl:

    $ ... |perl -pi -0e's/(?<!^)\n(?!\n)/ /mg; s/\n\n/\n/g'
    nimbox-apexer-sales 1.0.0-201007241449
    nimbox-tomcat 6.0.26-5
    

    or any set of other standard UNIX tools you happen to like.

    It’s certainly possible to go directly from the Packages file format to what you
    want, but using tools specialized for the job seems like a good idea to me.

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

Sidebar

Related Questions

Please help with the following: I have an input file that is quite heterogeneous
I have the following code to open a input and output file: if ((source_file_ptr
In an HTML file I have the following: <input type=... name=myInput1 /> In a
I have the following target: <target name=promptforchoice> <input addproperty=choice> Copy the file?. [Y, n]
I have the following in jsp: <form action=/ucReady2/uploadservlet method=post enctype=multipart/form-data> <label for=filename_1>File: </label> <input
I have progress.js file which has the following code $('#text_area_input').keyup(function() { var text_area_box =$(this).val();//Get
I have a html file like following: <form action=/2811457/follow?gsid=3_5bce9b871484d3af90c89f37 method=post> <div> <a href=/2811457/follow?page=2&amp;gsid=3_5bce9b871484d3af90c89f37>next_page</a> &nbsp;<input
I have the following input XML: <root age=1> <description>some text</description> <section> <item name=a> <uuid>1</uuid>
Assume I have the following input in Pig: some And I would like to
I have the following text input on a budget calculator form which displays the

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.