I have multiple entries in a file which look like this.
1HDZ-B 3NT5-A 0.489917 0.400067
1I30-B 2B35-E 0.879363 0.400068
1K0U-E 1UWK-A 0.969722 0.400072
1BPW-A 1EFL-C 0.556795 0.400077
1EFL-C 1BPW-A 0.556795 0.400077
1GIQ-B 3QJ5-B 0.997880 0.400077
1GEE-A 2B4R-O 0.829231 0.400080
for the 4th and 5th line,the first two columns are interchanged, i.e.1st column on line4 =2nd column on the subsequent line. so what if i want to keep only one line among lines 4 and 5. say the line 4, so that my file looks like this:
1HDZ-B 3NT5-A 0.489917 0.400067
1I30-B 2B35-E 0.879363 0.400068
1K0U-E 1UWK-A 0.969722 0.400072
1BPW-A 1EFL-C 0.556795 0.400077
1GIQ-B 3QJ5-B 0.997880 0.400077
1GEE-A 2B4R-O 0.829231 0.400080
also, there are multiple instances of this occurrence in my file. so how do i remove such redundant entries?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.