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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:01:20+00:00 2026-06-15T19:01:20+00:00

I have pipe separated file. I want to strip off digits starting with ’00’

  • 0

I have pipe separated file. I want to strip off digits starting with ’00’ of sub id keeping rest of numbers same.
For eg:
Karen Calvert50335491|0020380050335491|ACTIVE|100|KINGSPORT|KarenCalvert50335491@charter.net|8353/3000|RESIDENTIAL|FiberNode|TENNESSEE|00:00:00:20:0f:03|EAST|423-343-9250|HSIPLUS|1826 HIGHLAND ST|Service1|MA|01602

expected o/p-

Karen Calvert50335491|20380050335491|ACTIVE|100|KINGSPORT|KarenCalvert50335491@charter.net|8353/3000|RESIDENTIAL|FiberNode|TENNESSEE|00:00:00:20:0f:03|EAST|423-343-9250|HSIPLUS|1826 HIGHLAND ST|Service1|MA|01602

Note:In this file there are some mac address also wich are satritng with ’00’

Any help appreciated.
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-06-15T19:01:22+00:00Added an answer on June 15, 2026 at 7:01 pm

    Using sed:

     sed 's/^\([^|]*\)|0*\([^|]*\)/\1|\2/' input
    

    Which matches, captures and preserves the first column in \1 via ^\([^|]*\) and captures the second column in \2, skipping the leading 0’s via 0*\([^|]*\). Then it replaces the matched part (columns 1 and 2) with the captured parts of these columns via /\1|\2/.

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

Sidebar

Related Questions

I have a file with fields separated by pipe characters and I want to
I have a column with pipe separated values such as: '23|12.1| 450|30|9|78|82.5|92.1|120|185|52|11' I want
I have a text file , filled with pipe separated URLs, like this: http://www.example.com|http://www.example2.com|http://www.example3.com|....
I have a pipe to gnuplot which I use to graph a file. The
hi guys i have two pipe delimited files,first file contains 1000 records and second
I have the following file (above) which seems to be an Unix pipe alt
I have two tables which both contain 'pipe separated values' e.g: Table 1: DataField_A
Given a string of pipe-separated values (call it $psv ), I want to be
I have a string that has data separated by a pipe character ( |
If I have a pipe separated list can I split them automatically into an

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.