Skip to main content
added 62 characters in body
Source Link

The thing I wanna do is to check if the 2nd and the 3rd columns are repeating (if not repeating, take 4th, 5th and the 6th columns as they are), print the first element in 5th and the last element in 6th column with their corresponding 4th column.

Example input looks like this:

Chr1    39584   39678   Chr1    39653   39654
Chr1    39584   39678   Chr1    39654   39655
Chr1    39584   39678   Chr1    39677   39678
Chr1    40023   40039   Chr1    40038   40039
Chr1    283979  283993  Chr1    283979  283980
Chr1    283979  283993  Chr1    283980  283981
Chr1    283979  283993  Chr1    283989  283990
Chr1    283979  283993  Chr1    283990  283991
Chr1    283979  283993  Chr1    283992  283993

Desired output looks like this:

Chr1    39653   39678
Chr1    40038   40039
Chr1    283979  283993

Thanks!

The thing I wanna do is to check if the 2nd and the 3rd columns are repeating, print the first element in 5th and the last element in 6th column with their corresponding 4th column.

Example input looks like this:

Chr1    39584   39678   Chr1    39653   39654
Chr1    39584   39678   Chr1    39654   39655
Chr1    39584   39678   Chr1    39677   39678
Chr1    40023   40039   Chr1    40038   40039
Chr1    283979  283993  Chr1    283979  283980
Chr1    283979  283993  Chr1    283980  283981
Chr1    283979  283993  Chr1    283989  283990
Chr1    283979  283993  Chr1    283990  283991
Chr1    283979  283993  Chr1    283992  283993

Desired output looks like this:

Chr1    39653   39678
Chr1    40038   40039
Chr1    283979  283993

Thanks!

The thing I wanna do is to check if 2nd and the 3rd columns are repeating (if not repeating, take 4th, 5th and the 6th columns as they are), print the first element in 5th and the last element in 6th column with their corresponding 4th column.

Example input looks like this:

Chr1    39584   39678   Chr1    39653   39654
Chr1    39584   39678   Chr1    39654   39655
Chr1    39584   39678   Chr1    39677   39678
Chr1    40023   40039   Chr1    40038   40039
Chr1    283979  283993  Chr1    283979  283980
Chr1    283979  283993  Chr1    283980  283981
Chr1    283979  283993  Chr1    283989  283990
Chr1    283979  283993  Chr1    283990  283991
Chr1    283979  283993  Chr1    283992  283993

Desired output looks like this:

Chr1    39653   39678
Chr1    40038   40039
Chr1    283979  283993

Thanks!

Markup
Source Link
Kusalananda
  • 355.7k
  • 42
  • 735
  • 1.1k

The thing I wanna do is to check if the 2nd and the 3rd columns are repeating, print the first element in 5th and the last element in 6th column with their corresponding 4th column.

Example input looks like this:

Chr1 39584 39678 Chr1 39653 39654

Chr1 39584 39678 Chr1 39654 39655

Chr1 39584 39678 Chr1 39677 39678

Chr1 40023 40039 Chr1 40038 40039

Chr1 283979 283993 Chr1 283979 283980

Chr1 283979 283993 Chr1 283980 283981

Chr1 283979 283993 Chr1 283989 283990

Chr1 283979 283993 Chr1 283990 283991

Chr1 283979 283993 Chr1 283992 283993

Chr1    39584   39678   Chr1    39653   39654
Chr1    39584   39678   Chr1    39654   39655
Chr1    39584   39678   Chr1    39677   39678
Chr1    40023   40039   Chr1    40038   40039
Chr1    283979  283993  Chr1    283979  283980
Chr1    283979  283993  Chr1    283980  283981
Chr1    283979  283993  Chr1    283989  283990
Chr1    283979  283993  Chr1    283990  283991
Chr1    283979  283993  Chr1    283992  283993

Desired output looks like this:

Chr1 39653 39678

Chr1 40038 40039

Chr1 283979 283993

Chr1    39653   39678
Chr1    40038   40039
Chr1    283979  283993

Thanks!

The thing I wanna do is to check if the 2nd and the 3rd columns are repeating, print the first element in 5th and the last element in 6th column with their corresponding 4th column.

Example input looks like this:

Chr1 39584 39678 Chr1 39653 39654

Chr1 39584 39678 Chr1 39654 39655

Chr1 39584 39678 Chr1 39677 39678

Chr1 40023 40039 Chr1 40038 40039

Chr1 283979 283993 Chr1 283979 283980

Chr1 283979 283993 Chr1 283980 283981

Chr1 283979 283993 Chr1 283989 283990

Chr1 283979 283993 Chr1 283990 283991

Chr1 283979 283993 Chr1 283992 283993

Desired output looks like this:

Chr1 39653 39678

Chr1 40038 40039

Chr1 283979 283993

Thanks!

The thing I wanna do is to check if the 2nd and the 3rd columns are repeating, print the first element in 5th and the last element in 6th column with their corresponding 4th column.

Example input looks like this:

Chr1    39584   39678   Chr1    39653   39654
Chr1    39584   39678   Chr1    39654   39655
Chr1    39584   39678   Chr1    39677   39678
Chr1    40023   40039   Chr1    40038   40039
Chr1    283979  283993  Chr1    283979  283980
Chr1    283979  283993  Chr1    283980  283981
Chr1    283979  283993  Chr1    283989  283990
Chr1    283979  283993  Chr1    283990  283991
Chr1    283979  283993  Chr1    283992  283993

Desired output looks like this:

Chr1    39653   39678
Chr1    40038   40039
Chr1    283979  283993

Thanks!

added 245 characters in body
Source Link

The thing I wanna do is to check if the 2nd and the 3rd columns are repeating, print the first element in 5th and the last element in 6th column with their corresponding 4th column.

Example input looks like this:Example input looks like this:

enter image description here Chr1 39584 39678 Chr1 39653 39654

Desired output looks like this:Chr1 39584 39678 Chr1 39654 39655

enter image description here Chr1 39584 39678 Chr1 39677 39678

Chr1 40023 40039 Chr1 40038 40039

Chr1 283979 283993 Chr1 283979 283980

Chr1 283979 283993 Chr1 283980 283981

Chr1 283979 283993 Chr1 283989 283990

Chr1 283979 283993 Chr1 283990 283991

Chr1 283979 283993 Chr1 283992 283993

Desired output looks like this:

Chr1 39653 39678

Chr1 40038 40039

Chr1 283979 283993

Thanks!

The thing I wanna do is to check if the 2nd and the 3rd columns are repeating, print the first element in 5th and the last element in 6th column with their corresponding 4th column.

Example input looks like this:

enter image description here

Desired output looks like this:

enter image description here

Thanks!

The thing I wanna do is to check if the 2nd and the 3rd columns are repeating, print the first element in 5th and the last element in 6th column with their corresponding 4th column.

Example input looks like this:

Chr1 39584 39678 Chr1 39653 39654

Chr1 39584 39678 Chr1 39654 39655

Chr1 39584 39678 Chr1 39677 39678

Chr1 40023 40039 Chr1 40038 40039

Chr1 283979 283993 Chr1 283979 283980

Chr1 283979 283993 Chr1 283980 283981

Chr1 283979 283993 Chr1 283989 283990

Chr1 283979 283993 Chr1 283990 283991

Chr1 283979 283993 Chr1 283992 283993

Desired output looks like this:

Chr1 39653 39678

Chr1 40038 40039

Chr1 283979 283993

Thanks!

edited tags
Link
Kusalananda
  • 355.7k
  • 42
  • 735
  • 1.1k
Loading
Source Link
Loading