Where's your file2's lines 1 126 and 2 138in your output file? Does your specification imply lines in file2 that don't exist in file1 are to be suppressed? What happens to two or more consecutive lines in file1 missing in file2?
While scrutinizer's proposal may be very fast, it's difficult to get the two files back in sync if more than one line is missing in either.
After adding line 1 127 and 1 128 to file1, try this one:
hi,
i am facing a problem in merging two files using awk,
the problem is as stated below,
file1:
A|B|C|D|E|F|G|H|I|1
M|N|O|P|Q|R|S|T|U|2
AA|BB|CC|DD|EE|FF|GG|HH|II|1
....
....
....
file2 :
1|Mn|op|qr (2 Replies)
Hi
this question applies to Solaris 8,9,10 and opensolaris as in my environment it applies to all of these
Is there a limit on the size of the username (in /etc/passwd) or indeed does there come a point where, like the 8 character limitation of passwords, the system receives the input but... (6 Replies)
Hi there !
I need to treat files with variable line length, and process the tab-delimited words of each line. The tools I know are some basic bash scripting and sed ... I haven't got to python or perl yet.
So my file looks like this
obj1 0.01953 0.34576 0.04418 0.01249
obj2 0.78140... (7 Replies)
Hi all,
Sorry if someone has answered something like this already, but I have a problem. I am not brilliant with "awk" but think it should be the command to use to get what I am after.
I have 2 files:
job-file (several hundred lines like):
1018003,LONG MU WAN,1113S
1018004,LONG MU... (4 Replies)
Hi,
My requirement is,there is a directory location like:
:camp/current/
In this location there can be different flat files that are generated in a single day with same header and the data will be different, differentiated by timestamp, so i need to verify how many files are generated... (10 Replies)
Dear Gents,
Please I need your help... I need small script :) to do the following.
I have a thousand of files in a folder produced daily.
I need first to merge all files called. txt (0009.txt, 0010.txt, 0011.txt) and and to output a resume of all information on 2 separate files in csv... (14 Replies)
I have three files of varying lengths and different number of columns. How can I paste all three with all columns aligned?
File1
----
123
File2
----
234
345
678
File3
----
456
789
Output should look like:
123 234 456
345 789 (6 Replies)
Hi All,
I am trying to obtain count of characters using awk, but "length" function returns a value of 1 for 2-byte or 3-byte characters as well unlike wc -c command.
I have tried to use the below commands within awk function, but it does not seem to work
{
cmd="wc -c "stringtocheck
( cmd )... (6 Replies)
So my program is not working and I keep changing it to figure out why. So I have two questions, can I do tracing similar to bash, and also what is wrong with this.
The idea is simple, I want to count "word" lengths, with the loose definition of word not being a space, tab, or newline. Here is... (11 Replies)
Discussion started by: Riker1204
11 Replies
LEARN ABOUT OSX
zdiff
ZDIFF(1) BSD General Commands Manual ZDIFF(1)NAME
zcmp, zdiff -- compare compressed files
SYNOPSIS
zcmp [options] file [file2]
zdiff [options] file [file2]
DESCRIPTION
zcmp and zdiff are filters that invoke cmp(1) or diff(1) respectively to compare compressed files. Any options that are specified are passed
to cmp(1) or diff(1).
If only file1 is specified, it is compared against a file with the same name, but with the extension removed. When both file1 or file2 are
specified, either file may be compressed.
Extensions handled by gzip(1):
o z, Z,
o gz,
o taz,
o tgz.
Extensions handled by bzip2(1):
o bz,
o bz2,
o tbz,
o tbz2.
Extensions handled by xz(1):
o lzma,
o xz,
o tlz,
o txz.
ENVIRONMENT
TMPDIR Directory in which to place temporary files. If unset, /tmp is used.
FILES
/tmp/zcmp.XXXXXXXXXX Temporary file for zcmp.
/tmp/zdiff.XXXXXXXXXX Temporary file for zdiff.
SEE ALSO bzip2(1), cmp(1), diff(1), gzip(1), xz(1)CAVEATS
zcmp and zdiff rely solely on the file extension to determine what is, or is not, a compressed file. Consequently, the following are not
supported as arguments:
- directories
- device special files
- filenames indicating the standard input (``-'')
BSD May 23, 2011 BSD