Timeline for awk is automatically duplicating some lines. Can someone explain?
Current License: CC BY-SA 4.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 5, 2023 at 15:16 | review | Close votes | |||
| Mar 22, 2023 at 3:03 | |||||
| Mar 3, 2023 at 16:22 | comment | added | Ed Morton | It's obvious what's causing the problem you asked about (sometimes both of the first 2 conditions are true and you're printing each time) but it's not obvious what you wanted to do instead (e.g. what SHOULD $7 be set to if both of the first 2 conditions are true - $4 or $6 or some concatenation of both or $2 or something else?). If you edit your question to add the expected output for the sample input you provided and state that requirement then we can help you with that. -F " " is useless btw as that's setting FS to the default value it already has, just remove it. | |
| Mar 3, 2023 at 15:53 | comment | added | user563991 | That helps! Thanks so much. | |
| Mar 3, 2023 at 15:41 | answer | added | symcbean | timeline score: 1 | |
| Mar 3, 2023 at 15:38 | answer | added | ilkkachu | timeline score: 0 | |
| Mar 3, 2023 at 15:34 | comment | added | ilkkachu | If e.g. both $1==$3 and $1==$5 are true, both the first two blocks run and print. That's the case on lines 2 and 3. The two blocks also both set $7 from two different fields, though those are the same on the two lines it happens here. | |
| Mar 3, 2023 at 15:31 | history | edited | ilkkachu | CC BY-SA 4.0 | formatting, linewrap the code for readability |
| Mar 3, 2023 at 15:31 | history | edited | user563991 | CC BY-SA 4.0 | deleted 10 characters in body |
| Mar 3, 2023 at 15:30 | history | rollback | ilkkachu | Rollback to Revision 1 | |
| Mar 3, 2023 at 15:30 | history | edited | user563991 | CC BY-SA 4.0 | added 10 characters in body |
| S Mar 3, 2023 at 15:28 | review | First questions | |||
| Mar 3, 2023 at 15:49 | |||||
| S Mar 3, 2023 at 15:28 | history | asked | user563991 | CC BY-SA 4.0 |