Hi
I have a myfile.txt contains the following:
CONTEXT {
AAAAA
}
...
CONTEXT {
BBBBB
}
I want to extract the lines in between CONTEXT { ... }, one by one.
Hence I wrote a command like the following,
sed -n '/^CONTENT/,/^}/ {
w a.txt
}' myfile.txt
The problem with this... (5 Replies)
HI,
I have sentences like this:
@str=("An ribonucleic acid (RNA)-binding protein, started its expression in the daughter cells","Elucidation of the mechanism of retinal degeneration of RNA-binding protein","Rna binding protein is an important protein","In the retinal degenerative process... (1 Reply)
Hi,
I have the file contents:
Start,End,Req,Resp
12:39,12:40,4,5
The sting to be matched is: Req and Resp.
parsefile("Req,Resp");
Here is the code.
sub parsefile ($)
{
$header=shift; (2 Replies)
I have an ugly conf file that has the string I'm interested in searching for in the middle of a block of code that's relevant, and I'm trying to find a way to remove that entire block based on the matched line.
I've googled for this problem, and most people helping are only interested in... (9 Replies)
hi dudes, I nee you kind assistance, I have to find the matched numbers from 2 text files and output of matched numbers should be in another text file..
I do have text files like this , for example
File 1
787
665*5-p
5454
545-p
445-p
5454*-p
File 2
5455
787
445-p
4356
2445
144
... (3 Replies)
Hi all,
I have a text data file. My aim here is to find line called *FIELD* AV for every record and print lines after that till *FIELD* RF. But here I want first 3 to four lines for very record as well. FIELD AV is some where in between for very record. SO I am not sure how to retrieve lines in... (2 Replies)
Hi ,
I have been trying to write a perl script to do this job. But i am not able to achieve the desired result. Below is my code.
my $current_value=12345;
my @users=("bob","ben","tom","harry");
open DBLIST,"<","/var/tmp/DBinfo";
my @input = <DBLIST>;
foreach (@users)
{
my... (11 Replies)
Hi,
i need help to delete all the lines between 2 matched patterns and the first pattern must be deleted too. sample as follows:
inputfile.txt
>kump_1
...........................
...........................
>start_0124
dgfhghgfh
fgfdgfh
fdgfdh
>kump_2
............................. (7 Replies)
Hi,
If I have a file of something like
@hg19_gold_AL122127.6-131160
GCTTCATCATGCATGGATAGGCTGGCGCCTTTCCTGAGGCCATATGCCGATGGATATG
@hg19_gold_AL122127.6-131159
CTTTAATATTTCCGCCACCATCCTGAGTGAATCCCAGCAAGGACAGTCTTTGGGGATT
@hg19_gold_AL122127.6-131158... (4 Replies)
Hello, everyone
I have two files like this:
File 1: A
B
C
D
E
FFile 2:A B 1
A C 2
A K 3
B A 4
D E 3
W X 2
A B 2I want to print all lines (file2) that the first two columns are consist of elements from file1.
So, what I expected is :
A B 1
A B 2 (2 Replies)
Discussion started by: nengcheng
2 Replies
LEARN ABOUT PHP
localtime
LOCALTIME(3) 1 LOCALTIME(3)localtime - Get the local timeSYNOPSIS
array localtime ([int $timestamp = time()], [bool $is_associative = false])
DESCRIPTION
The localtime(3) function returns an array identical to that of the structure returned by the C function call.
PARAMETERS
o $timestamp
- The optional $timestamp parameter is an integer Unix timestamp that defaults to the current local time if a $timestamp is not
given. In other words, it defaults to the value of time(3).
o $is_associative
- If set to FALSE or not supplied then the array is returned as a regular, numerically indexed array. If the argument is set to
TRUE then localtime(3) returns an associative array containing all the different elements of the structure returned by the C func-
tion call to localtime. The names of the different keys of the associative array are as follows:
o "tm_sec" - seconds,
0 to 59
o "tm_min" - minutes,
0 to 59
o "tm_hour" - hours,
0 to 23
o "tm_mday" - day of the month,
1 to 31
o "tm_mon" - month of the year,
0 (Jan) to 11 (Dec)
o "tm_year" - years since 1900
o "tm_wday" - day of the week,
0 (Sun) to 6 (Sat)
o "tm_yday" - day of the year,
0 to 365
o "tm_isdst" - is daylight savings time in effect? Positive if yes,
0 if not, negative if unknown.
ERRORS /EXCEPTIONS
Every call to a date/time function will generate a E_NOTICE if the time zone is not valid, and/or a E_STRICT or E_WARNING message if using
the system settings or the $TZ environment variable. See also date_default_timezone_set(3)CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.1.0 | |
| | |
| | Now issues the E_STRICT and E_NOTICE time zone |
| | errors. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
localtime(3) example
<?php
$localtime = localtime();
$localtime_assoc = localtime(time(), true);
print_r($localtime);
print_r($localtime_assoc);
?>
The above example will output something similar to:
Array
(
[0] => 24
[1] => 3
[2] => 19
[3] => 3
[4] => 3
[5] => 105
[6] => 0
[7] => 92
[8] => 1
)
Array
(
[tm_sec] => 24
[tm_min] => 3
[tm_hour] => 19
[tm_mday] => 3
[tm_mon] => 3
[tm_year] => 105
[tm_wday] => 0
[tm_yday] => 92
[tm_isdst] => 1
)
SEE ALSO getdate(3).
PHP Documentation Group LOCALTIME(3)