I am a beginner in script writing, i tried to do the following
I have a set of files sorted by date in the format YYMMDD.s and .x and .r
I need to concatenate a header file to these sets of files so I used the following code
I expect it to concatenate the files based on the user input.
I have 2 problems, the first on is that it doesn't do this for example if I enter the value for i and j to be 0530 and 0531 for 30 and 31 of May it searches for a file named 08345 instead of 080530.
the other problem is how can i make the script to work for 2 different months? like I have the first file as 300508 and last file as 050608, the loop is not going o work there
Hi,
I have written a script to rename a file, but I can not add the current date (in YYYYMMDD-HHMM format)
can you please look at this cript, and help?
thanks,
#!/usr/local/bin/tcsh -f
set server = "$1"
set user = "$2"
if (-f $server) then
\mv $server $server.Saar.
endif (4 Replies)
Hi all,
please give me the commands using which i can compare 2 sorted files and get the difference in third file, indiating where the difference is from either file1 or file2.
as:
File1 (Original file)
GARRY
JOHN
JULIE
SAM
---------------
File2
DEV
GARRY
JOHN
JOHNIEE (7 Replies)
Hi:
I am trying to create some script that sorts the files in a subdirectory by date and concatenates the thre most recently created files.
SAy,
file1 date1
file2 date2
file3 date3
file4 date4
file5 date5
file6 date6
i only want to concatenate the first three which are the most... (4 Replies)
Say i have 2 files in the giving format:
file1
1 2 3 4
1 2 3 4
1 2 3 4
file2
1 2 3 4
1 2 3 4
1 2 3 4
I have a PERL code (loaned by one of u -i forgot who - thanks!) that extracts the 2nd column from each file and append horizontally to a new file:
perl -ane 'push @{$L->}, $F; close... (1 Reply)
Hi,
I want to merge two files with sorted integers. I want to merge two files to a single file such that there are no duplicates and the merged file should contain the integers in the sorted order. Just some idea or pointer to an implementation will help me a lot.
Thanks & Regards,... (4 Replies)
the sorting is based on name of file,
file size
modification time stamps o f file
it should dislay the output in the following format
"." and ".." enteries should be ignored
please give some idea how to do it (1 Reply)
I have multiple files; each file contains a certain data in a column view
simply i want to combine all those files into one file in columns
example
file1:
a
b
c
d
file 2:
1
2
3
4
file 3:
G (4 Replies)
Hi
I have a requirement like below
I need to sort the files based on the timestamp in the file name and run them in sorted order and then archive all the files which are one day old to temp directory
My files looks like this
PGABOLTXML1D_201108121235.xml... (1 Reply)
Gents,
I have lot of files in a folder where each file name includes the date of generation, then I would like to merge
all the files for each date in a complete file.
list of files in forder.
dsd01_121104.txt
dsd01_121105.txt
dsd01_121106.txt
dsd03_121104.txt
dsd03_121105.txt... (7 Replies)
Can anyone please help me i have 2 text files setup like the one below.
Textfile1:
randomemail1:randompassword1
randomemail2:randompassword2
randomemail3:randompassword3
randomemail4:randompassword4
randomemail5:randompassword5
Textfile2:
randompassword1:randomphrase1... (8 Replies)
Discussion started by: nufc
8 Replies
LEARN ABOUT PHP
datetime.modify
DATETIME.MODIFY(3) 1 DATETIME.MODIFY(3)DateTime::modify - Alters the timestamp
Object oriented style
SYNOPSIS
public DateTime DateTime::modify (string $modify)
DESCRIPTION
Procedural style
DateTime date_modify (DateTime $object, string $modify)
Alter the timestamp of a DateTime object by incrementing or decrementing in a format accepted by strtotime(3).
PARAMETERS
o $object
-Procedural style only: A DateTime object returned by date_create(3). The function modifies this object.
o $modify
-A date/time string. Valid formats are explained in Date and Time Formats.
RETURN VALUES
Returns the DateTime object for method chaining or FALSE on failure.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.6 | |
| | |
| | Absolute date/time statements now take effect. |
| | Previously, only relative parts were used. |
| | |
| 5.3.0 | |
| | |
| | Changed the return value on success from NULL to |
| | DateTime. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
DateTime.modify(3) example
Object oriented style
<?php
$date = new DateTime('2006-12-12');
$date->modify('+1 day');
echo $date->format('Y-m-d');
?>
Procedural style
<?php
$date = date_create('2006-12-12');
date_modify($date, '+1 day');
echo date_format($date, 'Y-m-d');
?>
The above examples will output:
2006-12-13
Example #2
Beware when adding or subtracting months
<?php
$date = new DateTime('2000-12-31');
$date->modify('+1 month');
echo $date->format('Y-m-d') . "
";
$date->modify('+1 month');
echo $date->format('Y-m-d') . "
";
?>
The above example will output:
2001-01-31
2001-03-03
SEE ALSO strtotime(3), DateTime.add(3), DateTime.sub(3), DateTime.setDate(3), DateTime.setISODate(3), DateTime.setTime(3), DateTime.setTimes-
tamp(3).
PHP Documentation Group DATETIME.MODIFY(3)