Hello,
I have two data (.txt) files which I need to do some operations on them simultaneously. for example:
file1:
word11 word12 word13
word21 word 22 word 23
word31 word32 word33
file2:
word11 word12 word13
word21 word 22 word 23
word31 word32 word33
I need to see if each word in the first column in the first file exists in the second column in the second file. This is not the problem, the problem is to receive both of the files to the same script. Is it possible?
I thought about two options, but none of them worked;
first option:
I wrote a main script and pipelined the first file to a secondary script (let's call it scr1), and pipelined the other file to another secondary script (let's call it scr2). In scr1 I moved the word I needed into a var, and in scr2 I did the same thing to the word I needed in the second file. The problem is that now I can't compare between these two vars, because they're in different scripts. Is there a way to do that?
second option:
I wrote a main script and pipelined the two files to a secondary script, but I can't do
set line1 = ($<)
set line2 = ($<)
(obviously)
and also, it joins both of the files together so I can't refer to both of them, because it's one file now.
Is there another way to do this? And was the beginning of one of my ways somehow correct?
I have to use C-Shell and I can't use sed and awk.
Thank you so much if you're able to help me.
Shira.