The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Validating XSL sheet data in Unix Data file ravijunghare UNIX for Dummies Questions & Answers 1 11-07-2008 09:32 AM
analyzing tcpdump output slumpia Shell Programming and Scripting 0 06-06-2008 02:41 PM
Analyzing Communal Tag Relationships for Enhanced Navigation and User Modeling iBot UNIX and Linux RSS News 0 03-23-2008 04:50 AM
Using loop reading a file,retrieving data from data base. Sonu4lov Shell Programming and Scripting 1 01-19-2007 03:38 AM
Analyzing System Core Files? TRUEST UNIX for Advanced & Expert Users 2 01-30-2003 12:10 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-25-2009
shira's Avatar
shira shira is offline
Registered User
  
 

Join Date: Jan 2009
Location: Israel
Posts: 35
analyzing data from more than one file

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.
 

Bookmarks

Tags
cshell, file read, pipelining

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:30 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0