Compare 2 files and match column data and align data from 3 column
Hello experts,
Please help me in achieving this in an easier way possible. I have 2 csv files with following data:
File1
File2
Output Required
============
I have tried to construct this code, and it doesn't produces the exact match on the 4th column. Here is the code and the output...
Hi,
I have a query about joining files using data ranges.
Example files below - I want to join file1 to file2 with matches where file1 column 1 is equal to file2 column1, and file1 column 2 is within the range of file2 columns 3 and 4. I would like rows which don't match to be printed too.
... (4 Replies)
Dear All,
I am new to this forum and please ignore my little knowledge :p
I have two types of data (a subset is given below)
data version 1:
439798 2 1
451209 1 2
508696 2 1
555760 2 1
582757 1 2
582889 1 2
691827... (2 Replies)
Dear all,
there is a nice solution for a text merge where the second file has only variables with a numeric range ( sorry, cannot post URL + thread is closed ). The real world is however more complicated than in the earlier example.
file1
A 1
A 2
A 3
B 1
B 2
B 3
B 4
C 1
C 2
C 3
C... (4 Replies)
Hi all,
I have 2 files
one file contain data like this in one column
AST3
GSTY4
JST3
second file containign data like this in 2 columns
AST3(PAXXX),GSTY4(PAXXY) it is used in diabetes
KST4 it is used in blood... (6 Replies)
Hi..
In the below sorted input file.. I am comparing the first 3 columns of data one by one row and it is a pipeline delimitter file..
AA|BB|CC|line1
AA|BB|CC|ine4
AA|BB|CC|line2
BB|CC|DD|line3
BB|CC|DD|line5
If first 3 columns of data matches with any record in the file the... (4 Replies)
Hi, I am newbie in shell script.
I need your help to solve my problem.
Firstly, I have 2 files of csv and i want to compare of the contents then the output will be written in a new csv file.
File1:
SourceFile,DateTimeOriginal
/home/intannf/foto/IMG_0713.JPG,2015:02:17 11:14:07... (8 Replies)
Hi guys, looking for some help with a way to compare data in two files but with some conditions.
example,
File 1 consists of
site1,10.1.1.1
site2,20.2.2.2
site3,30.3.3.3
File 2 contains
site1,l0.1.1.1
site2,50.1.1.1
site3,30.3.3.3
site4,40.1.1.1
I want to be able to match the... (1 Reply)
Hello,
I have this file outputData:
# cat /tmp/outputData
__Capacity^6^NBSC01_Licences^L3_functionality_for_ESB_switch
__Capacity^2100^NBSC01_Licences^Gb_over_IP
__Capacity^1837^NBSC01_Licences^EDGE_BSS_Fnc
__Capacity^1816^NBSC01_Licences^GPRS_CS3_and_CS4... (1 Reply)
Discussion started by: nypreH
1 Replies
LEARN ABOUT PHP
dateperiod.__construct
DATEPERIOD.__CONSTRUCT(3) 1 DATEPERIOD.__CONSTRUCT(3)DatePeriod::__construct - Creates a new DatePeriod object
SYNOPSIS
public DatePeriod::__construct (DateTimeInterface $start, DateInterval $interval, int $recurrences, [int $options])
DESCRIPTION
DatePeriod::__construct (DateTimeInterface $start, DateInterval $interval, DateTimeInterface $end, [int $options]) DatePeriod::__con-
struct (string $isostr, [int $options])
Creates a new DatePeriod object.
PARAMETERS
o $start
- The start date of the period.
o $interval
- The interval between recurrences within the period.
o $recurrences
- The number of recurrences.
o $end
- The end date of the period.
o $isostr
- An ISO 8601 repeating interval specification.
o $options
- Can be set to DatePeriod::EXCLUDE_START_DATE to exclude the start date from the set of recurring dates within the period.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.5.8 | |
| | |
| | $end type changed to DateTimeImmutable. Previ- |
| | ously, DateTime. |
| | |
| 5.5.0 | |
| | |
| | $start type changed to DateTimeImmutable. Previ- |
| | ously, DateTime. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
DatePeriod example
<?php
$start = new DateTime('2012-07-01');
$interval = new DateInterval('P7D');
$end = new DateTime('2012-07-31');
$recurrences = 4;
$iso = 'R4/2012-07-01T00:00:00Z/P7D';
// All of these periods are equivalent.
$period = new DatePeriod($start, $interval, $recurrences);
$period = new DatePeriod($start, $interval, $end);
$period = new DatePeriod($iso);
// By iterating over the DatePeriod object, all of the
// recurring dates within that period are printed.
foreach ($period as $date) {
echo $date->format('Y-m-d')."
";
}
?>
The above example will output:
2012-07-01
2012-07-08
2012-07-15
2012-07-22
2012-07-29
Example #2
DatePeriod example with DatePeriod::EXCLUDE_START_DATE
<?php
$start = new DateTime('2012-07-01');
$interval = new DateInterval('P7D');
$end = new DateTime('2012-07-31');
$period = new DatePeriod($start, $interval, $end,
DatePeriod::EXCLUDE_START_DATE);
// By iterating over the DatePeriod object, all of the
// recurring dates within that period are printed.
// Note that, in this case, 2012-07-01 is not printed.
foreach ($period as $date) {
echo $date->format('Y-m-d')."
";
}
?>
The above example will output:
2012-07-08
2012-07-15
2012-07-22
2012-07-29
PHP Documentation Group DATEPERIOD.__CONSTRUCT(3)