Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • So you don't actually want to compare but rather join two data sets on a given column? Would it be admissible to do this in, say, SQL? Also awk would indeed be suited for the task (although it wouldn't be a one-liner), but it's hard to wrap ones head around your description of what you want to achieve, tbh. For example is one supposed to match the first three fields of what seems like a time stamp or are the records running in parallel, so one could also go by the line number from the start? Commented May 19, 2015 at 15:32
  • they are ordered by time, but input1 have more lines from the same connection. EX. inputA A11 A12 A13 A14 A15 A16 A17 A18 A19 A110 A21 A22 A23 A24 A25 A26 A27 A28 A29 A210 A31 A32 A33 A34 A35 A36 A37 A38 A39 A310 inputB B11 B12 B13 B21 B22 B23 B31 B32 B33 I need to see if B11 match with A11 if so see if B12 match with A15 if so write first line of inputA && B13 else go to next line of B. If don't find any match write first line of A && "NOACT" Thanks for help Commented May 19, 2015 at 15:52
  • 1
    If I'm not mistaken the output of your example should be: NOACT OK NOACT NOT NOACT. I also think you meant to say you want a range of 1 second, not 1 minute. Commented May 19, 2015 at 16:58
  • Just to clarify, you need to check each line of fileA against all lines of fileB? Commented May 19, 2015 at 17:53
  • Yes it's 1 second and should be NOACT OK NOACT NOT NOTACT. Thank for the help, I will try the script Commented May 20, 2015 at 13:49