OK, then be little more specific. yday was half the lines as today in your example. This should not be assumed, I understand; so what be the number of lines in yday? Anything between today and today/2? Or today and zero? And what to do if yday has the same line count for e.g. 3 records and only half the line count starting at record 4? Is it possible yday has more lines for certain records?
yday.csv's record count is exactly equals to today.csv
the file I used as an example have same record count 3 and 3
it's purely coincidence that my example of yday and today has 3 records which is exactly half of not same record count file.
There could be possible that yday and today file counts could be 4 and 4.
This is the scenario for same record count.
and for not same record count it could be 6 and 2 or could be 6 and 3 .
please refer example case one and two are example of not same record count
case one
today.csv 6 count
yday.csv - 3 record count
merged file which matched column 5 and 6 of both file and print exactly 1st row with the value and 2nd row with NA NA
option two
today.csv 6 reocrd count
yday.csv - 2 record count missing column 5 and 6 (0 and 1) values
final merged file have 6 rows and since yday column 5 and 6 missed it's values
so f2.7 f2.8 f2.9 have values NA NA NA
and incase of same record count , both files have same record count and each column 5 and 6 have corresponding value for coulmn 5 and 6 in other file
today.csv
yday.csv
and final mergerd file
f1=today.csv
f2=yday.csv
f1.X today.csv's X column number
f2.X yday.csv's X column number
Last edited by manas_ranjan; 08-10-2012 at 05:16 AM..
Dear All, I have two file like this:
file1:
a1234
b1235
c4678
d7859
file2 :
e4575
f7869
g7689
h9687
I want output like this:
a1234
b1235
c4678 (2 Replies)
Hello,
I have a master database of a dictionary with the following structure:
a=b (b is a Unicode string)
a is the English part and b is the equivalent in a foreign language
I have also another file which has a database where the /b/ part of the string has been corrected by an expert. let us... (5 Replies)
Hi
I’m new to scripting and have only had about two days experience with this. I have questions about a bash/gawk script.
Problem:
I have 27 files, which needs to get merged into one, the files are separated into 8 subdivisions containing a 3 row data description. Example of data
File.1
... (7 Replies)
Hi everyone, need your help in sorting and merging two numerical lists
Example:
I have one list 1 2 3 4 5 7 and the other 4 6 8, then the final output should be 1 2 3 4 5 6 7 8
Requesting your kind help in this
Regards,
RB :) (1 Reply)
Hi All:
I have following files:
File 1:
<header>
text...
text ..
text ..
text ..
<\header>
x
y
z
...
File 2:
<header>
text...
text ..
text .. (4 Replies)
I have 2 files
file1.txt
a 123 aqsw
c 234 sfdr
fil2.txt
b 345 hgy
d 4653 jgut
I want to merger in such a manner the the output file should be
outfile.txt
a 123 aqsw
b 345 hgy
c 234 sfdr
d 4653 jgut
Do we have any command to achive this? (8 Replies)
Hi
All,
How can you sort a file that is doubled space ( where even number lines are blank lines) and still preserves the blank lines?
You can use grep,sed and regular expression.
Thanks
Vishal (4 Replies)
Hi All,
I am writing some data's into a file from C++ program. The files which i am writing is of fixed length . say 232 in length per line.
I am writing as . my c code is as
... (0 Replies)
Hey,
I have a problem with nslookup under the newly installed mandrake 9.1, and as I see now also under Redhat 8.0
I have a pc called evo with the ip 10.0.0.1 which entered correctly in the /etc/hosts file. Connection to the internet is via an adsl-router. I have the nameservers from my... (2 Replies)