I have a program that will export my data to a single file, but it assigns a file name that is overridden every time I run the program. I need to change the file name to have a sequential number in the filename.
How do I rename a file so that the filename contains the system date and time. I want... (5 Replies)
Hi Guys,
I need to script the renaming of files as followins:
files:
firstjd
secondjo
thirdjv
My script needs to insert the date/time infront of the last 2 characters of the filenames above, any ideas greatly received :)
the letters before the last 2 characters could change, I'm only... (7 Replies)
Hi,
I operate and use HF radars along the California coast for ocean surface currents. The devices use Mac OS as the control and logging software. The software generates thousands of files a week and while I've used PERL in the past to solve the problems of finding files I come to realize some... (6 Replies)
Hello,
I need to create a shell script that appends a filename to create a name with the date and time appended that is guaranteed to not exist. That is, the script insures you will not overwrite a file with the same name. I am lost with this one. I know I need to use date but after that I am... (3 Replies)
Hi,
There are similar kind of posts, but none seems like working for me. Please correct me if I'm wrong.
I need append/rename file abc.txt with file processed date and time like abc_systemdatetimestamp.txt
and move it to different folder.
for example I have
/source/data/abc.txt
... (1 Reply)
I'd like to convert a date string in the form of sun aug 19 09:03:10 EDT 2012, to unixtime timestamp using awk.
I tried
This is how each line of the file looks like, different date and time in this format
Sun Aug 19 08:33:45 EDT 2012, user1(108.6.217.236) all: test on the 17th
... (2 Replies)
Here is my sample data
Test.txt
column 1|columne 2|start Date|end Date
test|test|03/24/2014|03/24/2014
test|test|03/24-2014|03/24/2014
test|test|03/24/2014|03/24/2014
test|test|03/24/2014|03/24-2014
test|test|03/24/2014|03/24/2014
Now in the file i am expecting the date fields should be... (4 Replies)
Hi,
I'm totally new in sell script and working with a shell code. I want to extract the date and time from the filenames. The filenames are different but all of them begins with WI_ SCOPE_:
WI_SCOPE_DATA_CHANGE_2017-09-12_15-30-40.txt
WI_SCOPE_BACK_COMPLETE_QUEUE_2017-09-12_15-31-40.txt... (5 Replies)
Hi,
I am facing one scenario in which I need to extract exact position of date and time from the name of the files. For example, Below is the record in which I need to extract position of YYYYMMDD,HHMISS and YYMMDD. Date and time variables can come more than once. I need to use these position... (13 Replies)
Discussion started by: Prathmesh
13 Replies
LEARN ABOUT PHP
fileatime
FILEATIME(3) 1 FILEATIME(3)fileatime - Gets last access time of fileSYNOPSIS
int fileatime (string $filename)
DESCRIPTION
Gets the last access time of the given file.
PARAMETERS
o $filename
- Path to the file.
RETURN VALUES
Returns the time the file was last accessed, or FALSE on failure. The time is returned as a Unix timestamp.
EXAMPLES
Example #1
fileatime(3) example
<?php
// outputs e.g. somefile.txt was last accessed: December 29 2002 22:16:23.
$filename = 'somefile.txt';
if (file_exists($filename)) {
echo "$filename was last accessed: " . date("F d Y H:i:s.", fileatime($filename));
}
?>
ERRORS /EXCEPTIONS
Upon failure, an E_WARNING is emitted.
NOTES
Note
The atime of a file is supposed to change whenever the data blocks of a file are being read. This can be costly performance-wise
when an application regularly accesses a very large number of files or directories.
Some Unix filesystems can be mounted with atime updates disabled to increase the performance of such applications; USENET news
spools are a common example. On such filesystems this function will be useless.
Note
Note that time resolution may differ from one file system to another.
Note
The results of this function are cached. See clearstatcache(3) for more details.
Tip
As of PHP 5.0.0, this function can also be used with some URL wrappers. Refer to "Supported Protocols and Wrappers" to determine
which wrappers support stat(3) family of functionality.
SEE ALSO filemtime(3), fileinode(3), date(3).
PHP Documentation Group FILEATIME(3)