Timeline for Merge alternate lines from two files
Current License: CC BY-SA 3.0
20 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 17, 2015 at 11:17 | comment | added | terdon♦ | @mikeserv I'm not saying you did anything wrong, I'm annoyed at the OP, not you. As you well know, there are important differences both between Linux and Unix and between the various Unices. That's why it's important the OP tell us which they are using. | |
| Jun 17, 2015 at 11:06 | comment | added | kos | @mikeserv Thanks for the first one. I'll settle for it | |
| Jun 17, 2015 at 10:56 | history | edited | kos | CC BY-SA 3.0 | added 25 characters in body |
| Jun 17, 2015 at 10:55 | comment | added | mikeserv | @kos - sweet. That rules that out. Probably was an input error. I still can't upvote you again, though. Sorry. | |
| Jun 17, 2015 at 10:55 | comment | added | kos | @mikeserv However since I was at it I tried mawk also, and it runs on it as well. Anyway being reasonable I can't see why it shouldn't work just the other way around (i.e. just by switching files). It's not that awk cares about the input, lines are lines. If something wasn't supported by his version it would have just broke the first time. Way more easily, simply OP did a mistake switching the input files in the arguments. | |
| Jun 17, 2015 at 10:45 | comment | added | mikeserv | @terdon - they posted on Unix and Linux - it's one or the other - how specific should you have to be? And I didn't make that assumption, eiither. I was just letting kos know, I couldn't upvote the answer again, but I saw the comments here and so I let kos know what I did. What's wrong with that? As to guessing - is it not a guess already if your answer is prohibitive in some way, or limited by OS? | |
| Jun 17, 2015 at 10:40 | comment | added | terdon♦ | @mikeserv which is why I left a comment to the OP asking them to clarify. My point is that if the OP can't be bothered to tell us what OS they're using, we can't be expected to guess it from their history. Nor should we, there's no reason to assume they only use one. | |
| Jun 17, 2015 at 10:33 | comment | added | mikeserv | @terdon - I guess, but isn't this site all about the OS? | |
| Jun 17, 2015 at 10:31 | comment | added | terdon♦ | @mikeserv it is the OP's responsibility to mention the OS. If they don't, it's not up to us to go search the OP's history and guess it. We don't know how many machines they have or if they all use Solaris or what. All we can do is provide answers based on the information we have. If that's not good enough for the OP, it will be for the next person who stumbles upon the answer. | |
| Jun 17, 2015 at 10:29 | comment | added | mikeserv | @kos - it's probably mawk - it's Solaris. | |
| Jun 17, 2015 at 10:24 | comment | added | kos | @Nainita Can you provide the version of awk you're using? | |
| Jun 17, 2015 at 10:24 | comment | added | kos | @mikeserv Not that it seems. FNR is a gawk / nawk feature, so if it works it means he/she's not using the original awk which lacks it, and if it works one way it should work the other way around also. Unless he/she's using something other than the original awk, gawk or nawk which might lack something else. | |
| Jun 17, 2015 at 10:04 | comment | added | mikeserv | @kos - if it matters, most of Nainita's other questions have been targeted at a Solaris system. Is it possible your script uses some non-standard syntax which might result as he/she indicates? | |
| Jun 17, 2015 at 8:56 | comment | added | kos | @Nainita No, it doesn't. Try again: awk 'NR==FNR {x[FNR]=$0;next} {print x[FNR]"\n"$0}' file1 file2. | |
| Jun 17, 2015 at 8:53 | comment | added | Nainita | Yes...I have done the same but it was printing the exactly as before . after printing tid.setnr then it was priting tid.info. | |
| Jun 17, 2015 at 8:48 | comment | added | kos | @Nainita Anyway to switch the order of the output you can just switch file1 and file2 in the command. | |
| Jun 17, 2015 at 8:46 | comment | added | kos | @Nainita That's what you're showing in your example output. | |
| Jun 17, 2015 at 8:42 | comment | added | Nainita | It's giving the output but not exactly the same what I wanted. tid.info lines are coming after tid.setnr lines in my output file. | |
| Jun 17, 2015 at 8:19 | history | edited | kos | CC BY-SA 3.0 | added 479 characters in body |
| Jun 17, 2015 at 7:59 | history | answered | kos | CC BY-SA 3.0 |