Sponsored Content
Top Forums Shell Programming and Scripting analyzing data from more than one file Post 302279945 by shira on Sunday 25th of January 2009 07:37:54 AM
Old 01-25-2009
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.
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Analyzing System Core Files?

can some tell me how to do this. I mean, i tried finding this out on my own but when I checked the man pages, i got a truckload of commands available pertaining to this task which in turn got me confused. so my question is, if there is a simple straight forward(not necessarily easy) way to... (2 Replies)
Discussion started by: TRUEST
2 Replies

2. Shell Programming and Scripting

analyzing tcpdump output

hello, i have a lot of pcap files (tcpdump output) that i want to compare. every tcpdump output has two file, server and client. what i want to do is: 1. take timestamp, source address, destination address, and packet id from each file (server and client) 2. find the packets sent from... (0 Replies)
Discussion started by: slumpia
0 Replies

3. AIX

Help required in analyzing errpt in aix 5.3

I have received errpt like this.Any help will be highly appreciated.Recently my application has been migrated to aix 5.3 and working fine in aix 5.2 with out crashes. LABEL: CORE_DUMP IDENTIFIER: C69F5C9B Date/Time: Thu Apr 23 09:41:29 EDT 2009 Sequence Number: 948... (3 Replies)
Discussion started by: kittu1979
3 Replies

4. Emergency UNIX and Linux Support

Analyzing Core Dump

We have a binary that generates coredump. So I ran the gdb command to analyze the issue. Pleae note the binary and code are in two different locations and we cannot build the whole binary using debugging symbols. Hence how and what details can I find from below backtarce: gdb binary corefile ... (5 Replies)
Discussion started by: uunniixx
5 Replies

5. UNIX and Linux Applications

Benchmarking and performance analyzing in OS

Is/Are there an/some application/applications , package/packages for benchmarking or system performance measuring which are there for almost all Linux releases and distributions? (2 Replies)
Discussion started by: nixhead
2 Replies

6. UNIX for Dummies Questions & Answers

analyzing list with street addresses

Hi List, Could someone please point me into the right direction with the following: I have a file containing a list of street addresses. I need to sort all the street addresses with the same number to a new file containing the street name and corresponding number. So: Strawinskylaan... (3 Replies)
Discussion started by: M474746
3 Replies

7. AIX

Analyzing CPU usage

Hi Admins, I need your help to analyze the cpu usage of our main server. I have shared below, CPU usages during busy hours and non busy hours. CPU usage is always full at busy hours. Users always complaints about slowness. This server is a lpar partition and configured as uncapped mode. ... (7 Replies)
Discussion started by: newaix
7 Replies

8. Programming

Difficult in analyzing an algorithm

Hello, I was reading Heuritics text and came across an algorithm below. Finding hard to analyze it can any one help me out below... How to analyze if I take say no. of types are 5 and each type has say 20 coins. thanks. Let {c1, c2...cn=1} be a set of distinct coin types where ci is... (1 Reply)
Discussion started by: sureshcisco
1 Replies

9. Homework & Coursework Questions

Lex: analyzing a C file and printing out identifiers and line numbers they're found on

Florida State University, Tallahassee, FL USA, Dr. Whalley, COP4342 1. The problem statement, all variables and given/known data: Create a lex specification file that reads a C source program that ignores keywords and collects all identifiers (regular variable names) and also displays the line... (3 Replies)
Discussion started by: D2K
3 Replies
XZDIFF(1)							     XZ Utils								 XZDIFF(1)

NAME
xzcmp, xzdiff, lzcmp, lzdiff - compare compressed files SYNOPSIS
xzcmp [cmp_options] file1 [file2] xzdiff [diff_options] file1 [file2] lzcmp [cmp_options] file1 [file2] lzdiff [diff_options] file1 [file2] DESCRIPTION
xzcmp and xdiff invoke cmp(1) or diff(1) on files compressed with xz(1), lzma(1), gzip(1), or bzip2(1). All options specified are passed directly to cmp or diff. If only one file is specified, then the files compared are file1 (which must have a suffix of a supported com- pression format) and file1 from which the compression format suffix has been stripped. If two files are specified, then they are uncom- pressed if necessary and fed to cmp(1) or diff(1). The exit status from cmp or diff is preserved. The names lzcmp and lzdiff are provided for backward compatibility with LZMA Utils. SEE ALSO
cmp(1), diff(1), xz(1), gzip(1), bzip2(1), zdiff(1) BUGS
Messages from the cmp(1) or diff(1) programs refer to temporary filenames instead of those specified. Tukaani 2009-07-05 XZDIFF(1)
All times are GMT -4. The time now is 01:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy