Hi friends :)
I am having a small problem and ur help is needed...
I have a long file from which i want to select only some portions after filtering (grep).
My file looks like :
header
xxyy
lmno
xxyy
wxyz
footer
header
abcd
xy
pqrs
footer
.
. (14 Replies)
Hi ,
I want to select data from a file .the datas in a file will be in both upper and lower case. can able to select particular data using awk.
file is like
Ram Selva 24332 UNIXTEAM
Karthi Siva 43322 UNIXTEAM
In read if i enter selva as lowercase its not displaying result. (9 Replies)
Hi,
I would like to know how can I select lines of one file based on a common ID column from another file (keeping the order of the second file).
Example of file1:
ID A B C D
1-30 1 2 3
5-60 4 5 6
1-20 7 8 9
Example of file2:
ID chr pos
1-20 1 20
1-30 1 30
5-60 5 60
Desired... (2 Replies)
Hello,
I use UBUNTU 12.04.
I want to write a short program using awk to select some lines in a file based on a second file.
My first file has this format with about 400,000 lines and 47 fields:
SNP1 1 12.1
SNP2 1 13.2
SNP3 1 45.2
SNP4 1 23.4
My second file has this format:
SNP2
SNP3... (1 Reply)
Hi,
I have a data file with :
01/28/2012,1,1,98995
01/28/2012,1,2,7195
01/29/2012,1,1,98995
01/29/2012,1,2,7195
01/30/2012,1,1,98896
01/30/2012,1,2,7083
01/31/2012,1,1,98896
01/31/2012,1,2,7083
02/01/2012,1,1,98896
02/01/2012,1,2,7083
02/02/2012,1,1,98899
02/02/2012,1,2,7083
I... (1 Reply)
Hi
I need to select lines from a txt file, I have got a line starting with ZMIO:MSISDN= and after a few line I have another line starting with 'MOBILE STATION ISDN NUMBER' and another one starting with 'VLR-ADDRESS' I need to copy these three lines as three different columns in a separate... (3 Replies)
Hello all,
Once again I need to call upon the masters for help. I have a file called endpoint_data. IN that file I have groups of endpoints. However all I need from the file is this....
ENDPOINT NAME = SIPWOODSBC
SIG PRI FQDN/IP ADDRESS/DOMAIN NAME = 10.xxx.xxx.xxx
SIG SEC... (4 Replies)
Hi all,
I am new to AWK and I am trying to solve a problem that is probably easy for an expert. Suppose I have the following data file input.txt:
20 35 43
20 23 54
20 62 21
20.5 43 12
20.5 33 11
20.5 89 87
21 33 20
21 22 21
21 56 87
I want to select from all lines having the... (4 Replies)
Hi Folks,
I have the below feed file named abc1.txt in which you can see there is a title and below is the respective values in the rows and it is completely pipe delimited file ,.
... (3 Replies)
Discussion started by: punpun66
3 Replies
LEARN ABOUT PHP
dateinterval.format
DATEINTERVAL.FORMAT(3) 1 DATEINTERVAL.FORMAT(3)DateInterval::format - Formats the interval
SYNOPSIS
public string DateInterval::format (string $format)
DESCRIPTION
Formats the interval.
PARAMETERS
o $format
-
The following characters are recognized in the $format parameter string. Each format character must be prefixed by a percent sign (
%).
+------------------+--------------------------------------+---+
|$format character | | |
| | | |
| | Description | |
| | | |
| | Example values | |
| | | |
+------------------+--------------------------------------+---+
| | | |
| % | | |
| | | |
| | Literal % | |
| | | |
| | | |
| | % | |
| | | |
| | | |
| Y | | |
| | | |
| | Years, numeric, at least 2 digits | |
| | with leading 0 | |
| | | |
| | | |
| | 01, 03 | |
| | | |
| | | |
| y | | |
| | | |
| | Years, numeric | |
| | | |
| | | |
| | 1, 3 | |
| | | |
| | | |
| M | | |
| | | |
| | Months, numeric, at least 2 digits | |
| | with leading 0 | |
| | | |
| | | |
| | 01, 03, 12 | |
| | | |
| | | |
| m | | |
| | | |
| | Months, numeric | |
| | | |
| | | |
| | 1, 3, 12 | |
| | | |
| | | |
| D | | |
| | | |
| | Days, numeric, at least 2 digits | |
| | with leading 0 | |
| | | |
| | | |
| | 01, 03, 31 | |
| | | |
| | | |
| d | | |
| | | |
| | Days, numeric | |
| | | |
| | | |
| | 1, 3, 31 | |
| | | |
| | | |
| a | | |
| | | |
| | Total number of days as a result of | |
| | a DateTime::diff or (unknown) other- | |
| | wise | |
| | | |
| | | |
| | 4, 18, 8123 | |
| | | |
| | | |
| H | | |
| | | |
| | Hours, numeric, at least 2 digits | |
| | with leading 0 | |
| | | |
| | | |
| | 01, 03, 23 | |
| | | |
| | | |
| h | | |
| | | |
| | Hours, numeric | |
| | | |
| | | |
| | 1, 3, 23 | |
| | | |
| | | |
| I | | |
| | | |
| | Minutes, numeric, at least 2 digits | |
| | with leading 0 | |
| | | |
| | | |
| | 01, 03, 59 | |
| | | |
| | | |
| i | | |
| | | |
| | Minutes, numeric | |
| | | |
| | | |
| | 1, 3, 59 | |
| | | |
| | | |
| S | | |
| | | |
| | Seconds, numeric, at least 2 digits | |
| | with leading 0 | |
| | | |
| | | |
| | 01, 03, 57 | |
| | | |
| | | |
| s | | |
| | | |
| | Seconds, numeric | |
| | | |
| | | |
| | 1, 3, 57 | |
| | | |
| | | |
| R | | |
| | | |
| | Sign " -" when negative, " +" when | |
| | positive | |
| | | |
| | | |
| | -, + | |
| | | |
| | | |
| r | | |
| | | |
| | Sign " -" when negative, empty when | |
| | positive | |
| | | |
| | | |
| | -, | |
| | | |
+------------------+--------------------------------------+---+
RETURN VALUES
Returns the formatted interval.
NOTES
Note
The DateInterval::format method does not recalculate carry over points in time strings nor in date segments. This is expected
because it is not possible to overflow values like "32 days" which could be interpreted as anything from "1 month and 4 days" to "1
month and 1 day".
EXAMPLES
Example #1
DateInterval example
<?php
$interval = new DateInterval('P2Y4DT6H8M');
echo $interval->format('%d days');
?>
The above example will output:
4 days
Example #2
DateInterval and carry over points
<?php
$interval = new DateInterval('P32D');
echo $interval->format('%d days');
?>
The above example will output:
32 days
Example #3
DateInterval and DateTime::diff with the %a and %d modifiers
<?php
$january = new DateTime('2010-01-01');
$february = new DateTime('2010-02-01');
$interval = $february->diff($january);
// %a will output the total number of days.
echo $interval->format('%a total days')."
";
// While %d will only output the number of days not already covered by the
// month.
echo $interval->format('%m month, %d days');
?>
The above example will output:
31 total days
1 month, 0 days
SEE ALSO
DateTime::diff.
PHP Documentation Group DATEINTERVAL.FORMAT(3)