Hey all, I have a file structure that looks something like this:
file1
Code:
306708278
88954535
234167885
file2
Code:
2012-03-27T12:32:56+00:00 137 Orchotorena 184616310003601409 306708278 es 40.4777947 Majadahonda -3.6416896333333333 0 false atlante83 "<a href=""http://tapbots.com/tweetbot"" rel=""nofollow"">Tweetbot for iOS</a>" @Orchotorena un negro en edición es una imágen sin luminancia o negra. Se puede usar intencionalmente para separar planos false 184619011038920705 88954535
2012-03-27T12:32:56+00:00 137 elasadumz 184617507607429120 238467064 id -6.168961 Surakarta, Indonesia 106.83324766666668 0 false Eka_put3 web @elasadumz loh aku og gx d sapa??? false 184619010195849216 386451538
2012-03-27T12:32:57+00:00 137 en -3.109555 no ♥ da minha gatinha. -60.009778 0 false jessicavaanessa "<a href=""http://foursquare.com"" rel=""nofollow"">foursquare</a>" I just ousted Guilherme C. as the mayor of Bebedouro Do Ceme on @foursquare! http://t.co/CfIF2LTm false 184619011361869825 192336667
2012-03-27T12:32:57+00:00 137 en -3.109555 no ♥ da minha gatinha. -60.009778 0 false jessicavaanessa "<a href=""http://foursquare.com"" rel=""nofollow"">foursquare</a>" I'm at Bebedouro Do Ceme (Manaus, Amazonas) http://t.co/7ZM7caXy false 184619011592552448 192336667
2012-03-27T12:32:57+00:00 137 en 59.0687737 Oslo, Norway 11.529263533333333 0 false jonarnesen web ...dømt i går, pågrepet i dag for nyere forhold, og noen klager på at prøvetiden på førerkort ikke fungerer... #mullahkrekar #krekar #mullah false 184619011747741697 18520064
2012-03-27T12:32:57+00:00 137 ja 34.7054449 大阪府 135.49594045 0 false mucchi0312 "<a href=""http://foursquare.com"" rel=""nofollow"">foursquare</a>" I'm at Supporter's Field http://t.co/xdHMBFyC false 184619011697426432 495949802
2012-03-27T12:32:57+00:00 137 it 39.391708799999996 CA-Sardinia Magic Island 9.3025356 0 false AaronnMax web Listenin.... Jimmy Reed false 184619011689033728 445455678
2012-03-27T12:32:57+00:00 137 en 3.1484500499999997 kuala lumpur 101.71766273333333 0 false RainaBalqis web Kalau dj tak suka sgt ngn aku, tukar je lah tempat duduk aku.Takyah nk simpan dlm benak kau tu. false 184619011991027712 234167885
And, what I'm looking to do is to isolate the rows from file2 where file1 is matched in either file2's 6th or 18th columns. A simple grep won't do it because in reality, file1 is too large to just pass along - definitely more than a couple hundred thousand lines. So, anyone have an idea on this? Also, obviously, this is my first post, so if I screwed up my post, that's why. I've been looking for the past few hours at sed, awk, and grep and comm and all sorts of combinations and tweaks, but can't hack this one out, as I'm getting to the limits of understanding how shell scripting works.
Dear all,
I have two files in UNIX File1 and File2 as below:
File1:
1,1234,.,67.897,,0
1,4134,.,87.97,,4
0,1564,.,97.8,,1
File2:
2,8798,.,67.897,,0
2,8879,.,77.97,,4
0,1564,.,97.8,,1
I want to do the following:
(1) Make sure that both the files have equal number of columns and if... (1 Reply)
Dear all,
I have two files in UNIX File1 and File2 as below:
File1:
1,1234,.,67.897,,0
1,4134,.,87.97,,4
0,1564,.,97.8,,1
File2:
2,8798,.,67.897,,0
2,8879,.,77.97,,4
0,1564,.,97.8,,1
I want to do the following:
(1) Make sure that both the files have equal number of columns and if... (4 Replies)
Hey all,
So I have this challenge where I am attempting to compare record counts from within several different log files. I want input and output counts for each file, and I want to compare that with the result of the input/output comparison from a separate--but related file.
Example:
... (2 Replies)
Hi,
I have two files with the same number of columns. Basically I want to print the 2 columns that match between the two files.
File1 looks like this:
dr12 12 6 abn
dr14 12 7 abn
File2 looks something like this:
dr12 12 8 abn
dr12 14 7 abn
So basically if the first... (1 Reply)
Hi,
I have two files. File1.txt has 2 columns and looks like:
458739 122345
4456 122657
34200 122600
File2.txt has many columns with column 1 the same as column2 of File1.txt, but with lot more rows:
122786 abcdefg user1@email
122778 uuhjeufh user2@email... (1 Reply)
Hello,
I have two files as 1.txt and 2.txt with number as columns.
1.txt
0 53.7988
1 -30.0859
2 20.1632
3 14.2135
4 14.6366
5 -37.6258
.
.
.
31608 -8.57333
31609 -2.58554
31610 -24.2857
2.txt (1 Reply)
Hi,
I have a single-column file1 having records like:
00AB01/11
43TG22/00
78RC09/34
......
......
and a second file , file 2 having two columns like
78RC09/34 1
45FD11/11 2
00AB01/11 3
43TG22/00 4
......
...... (8 Replies)
Hi,
I have a file like this:
abc
def
ghi
jkl
mno
My second file is like this (tab delimited):
adsad sdfsdf dfdf
wads abc dfdsf
sdsf jkl sfsdf
dsfds sdfd reor
zxczd dsf sff
Now, I want the code to report the lines (from file2) which have common strings in column 2 with the first... (4 Replies)
Hi
I have large text file consisting of five columns. Sample of the file is give below:
ed 2-4 12.0 commons that they depended on. मानवों नष्ट किया जिन पर वो आधारित थे।
ed 3-1 12.0 Almost E, but would be over. रचना करीब करीब ई तक जाती है, मगर तब तो नाटक ख़त्म हो... (2 Replies)
Hi,
I'm trying to copy and paste the sixth column from a bunch of files into a single file having each column pasted in separate columns (and not one after each other in just one column.)
I tried this code but works only partially because it copied and pasted 50 rows of each column... (6 Replies)
Discussion started by: Frastra
6 Replies
LEARN ABOUT MINIX
diff
DIFF(1) General Commands Manual DIFF(1)NAME
diff - print differences between two files
SYNOPSIS
diff [-c | -e | -C n] [-br]file1 file2
OPTIONS -C n Produce output that contains n lines of context
-b Ignore white space when comparing
-c Produce output that contains three lines of context
-e Produce an ed-script to convert file1 into file2
-r Apply diff recursively to files and directories of
EXAMPLES
diff file1 file2 # Print differences between 2 files
diff -C 0 file1 file2
# Same as above
diff -C 3 file1 file2
# Output three lines of context with every
diff -c file1 file2 # Same
diff /etc /dev # Compares recursively the directories /etc and /dev
diff passwd /etc # Compares ./passwd to /etc/passwd
DESCRIPTION
the same name, when file1 and file2 are both directories" difference encountered"
Diff compares two files and generates a list of lines telling how the two files differ. Lines may not be longer than 128 characters. If
the two arguments on the command line are both directories, diff recursively steps through all subdirectories comparing files of the same
name. If a file name is found only in one directory, a diagnostic message is written to stdout. A file that is of either block special,
character special or FIFO special type, cannot be compared to any other file. On the other hand, if there is one directory and one file
given on the command line, diff tries to compare the file with the same name as file in the directory directory.
SEE ALSO cdiff(1), cmp(1), comm(1), patch(1).
DIFF(1)