Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi expert guys, I need your help with awk or python scripting! I need to find and mark rows in my file where there are element repeated in the following way:
input.file:
a_1 b_3
c_ 3 d_ 5
e_4 a_1
b_3 a_1
d_5 c_4
g_10 d_5
d_5 c_3needed output.file:
a_1 b_3
c_ 3 d_ 5
e_4 a_1
# b_3 a_1
d_5 c_4
g_10 d_5
# d_5 c_3thank you very much in advance!

I do not recognize any pattern other than put a # sign in front of any line that equals 'b_3 a_1' or 'd_5 c_3'. Is that correct? Or am I missing something?

ok, sorry, I did not explained it clearly. In
a_1 b_3
c_ 3 d_ 5
e_4 a_1
# b_3 a_1
d_5 c_4
g_10 d_5
# d_5 c_3the 2 rows # b_3 a_1 and # d_5 c_3 have the same elements of row 1 and row 2, respectively, but in different order. let s say: for every given row
a b
I want to find if there is a different row with:
b a
Is is clear now? thanks a lot for your time!

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |