Computing.Net > Forums > Unix > compare rows

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

compare rows

Reply to Message Icon

Name: antig78
Date: October 20, 2009 at 05:03:11 Pacific
OS: Linux i686
Subcategory: General
Comment:

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_3

needed 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_3

thank you very much in advance!



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: October 20, 2009 at 09:07:40 Pacific
Reply:

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?


0

Response Number 2
Name: antig78
Date: October 20, 2009 at 12:27:17 Pacific
Reply:

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_3

the 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!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: compare rows

How to do data cleansing in unix www.computing.net/answers/unix/how-to-do-data-cleansing-in-unix/7068.html

Need help in retrieving mult. rows www.computing.net/answers/unix/need-help-in-retrieving-mult-rows/6832.html

Compare Fields in two Files www.computing.net/answers/unix/compare-fields-in-two-files/7153.html