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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:49:54+00:00 2026-06-07T16:49:54+00:00

One part of my problem was solved with this answer: Threadlink , but an

  • 0

One part of my problem was solved with this answer:
Threadlink
, but an important part of my problem was unsolved!

After using

diff a.csv b.csv | grep -E -A1 '^[0-9]+d[0-9]+$' | grep -v '^--$' | sed -n '0~2 p' | sed -re 's,^< (.*)$,\1,g'

several times i found something left.
Sometimes multible following lines are deleted.
If only one line was deleted there are something like this found:

3663d3661

For multible lines it is:

3724,3725d3718

So i changed the diff call to:

diff a.csv b.csv | grep -E -A1 '^[0-9]+\,*[0-9]*d[0-9]+$' | grep -v '^--$' | sed -n '0~2 p' | sed -re 's,^< (.*)$,\1,g'

This works for the first of multiple deleted lines.

My question is:
How could i get all deletet lines (maybe 5 following lines) in such a case?
What did i have to change in the diff call?

  • 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-07T16:49:56+00:00Added an answer on June 7, 2026 at 4:49 pm
    diff a.csv b.csv | sed -n '/^[0-9]\+d[0-9]*/,/^[0-9]\+[^d]*$/{/^[0-9]\+/d;s/^< //;p}'
    

    will do that.

    /^[0-9]\+d[0-9]*/,/^[0-9]\+[^d]*$/
    

    will find the string range which are deleted

    /^[0-9]\+/d
    

    will delete all 6842d6844,6772

    s/^< //
    

    will replace all < in the beginning of lines

    and p will print the line.

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

Sidebar

Related Questions

I asked this question and got an excellent answer (thanks!). Part of the problem
Good day everyone. This problem was part of another one which it as been
MySqlDb is a fantastic Python module -- but one part is incredibly annoying. Query
I'am maintaining a GUI built using JQuery. In one part of the GUI, multiple
I know there are actually a number of questions similar to this one, but
NOTE: I know the various reasons to avoid using the session, but this is
EDIT: Problem solved. This was (yet another) situation where the problem wasn't really where
I would like to solve the following problem using constraints but i actually don't
In the spirit of being helpful, this is a problem I had and solved,
right the problem is a smallish one but hope someone can help. Basically we

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.