I need to build a k shell script that will sort files in a directory where files appear like this "XXXX_2008021213.DAT. I need to sort by date in the filename and then move files by individual date to a working folder. concatenate the files in the working folder then start a process once... (2 Replies)
I am wanting to search a directory tree and return files that are older than a specified datetime. So far straight forward with find, now I want to sort in date order and format the output.
So far I have this, but is not working and there is a problem with "." in the file and/or path names.
... (2 Replies)
Hi All,
I need to find all files other than first two files dates & last file date for month and month/year wise list.
lets say there are following files in directory
Mar 19 2012 c.txt
Mar 19 2012 cc.txt
Mar 21 2012 d.txt
Mar 22 2012 f.txt
Mar 24 2012 h.txt
Mar 25 2012 w.txt
Feb 12... (2 Replies)
Hi all,
Need an urgent help on the below scenario.
script:
awk -F","
'BEGIN { #some variable assignment}
{ #some calculation and put values in array}
END {
year=#getting it from array and assume this will be 2014
month=#getting it from array and this will be 05
date=#... (7 Replies)
hi all,
How to compare two files whether they are same are not...? like i had my input files as 20141201_file.txt and 20141130_file2.txt
how to compare the above files based on date .. like todays file and yesterdays file...? (4 Replies)
Good evening, Im newbie at unix specially with awk
From an scheduler program called Autosys i want to extract some data reading an inputfile that comprises jobs names, then formating the output to columns for example
1.
This is the inputfile:
$ more MapaRep.txt
ds_extra_nikira_usuarios... (18 Replies)
My unix version is IBM AIX Version 6.1
I tried google my requirement and found the below answer,
find . -newermt “2012-06-15 08:13" ! -newermt “2012-06-15 18:20"
But newer command is not working in AIX version 6.1 unix
I have given my requirement below:
Input:
atr files:
... (1 Reply)
Hi Team,
This is my first post, hope I am doing it right.
I have a large file, like 6 GB. Its a proxy file so vendor requested to change username from logs for saving the confidentiality of the user.
This is the script I created (With the help of Google):
awk '{
tmp="echo " $5 " |... (12 Replies)
current date command runs well
awk -v t="$(date +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
subtract 30 days fails
awk -v t="$(date --date="-30days" +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
awk command in hp unix subtract 30 days automatically from current date without date illegal option error... (20 Replies)
Discussion started by: kmarcus
20 Replies
LEARN ABOUT DEBIAN
datetime::format::sqlite
DateTime::Format::SQLite(3pm) User Contributed Perl Documentation DateTime::Format::SQLite(3pm)NAME
DateTime::Format::SQLite - Parse and format SQLite dates and times
SYNOPSIS
use DateTime::Format::SQLite;
my $dt = DateTime::Format::SQLite->parse_datetime( '2003-01-16 23:12:01' );
# 2003-01-16 23:12:01
DateTime::Format::SQLite->format_datetime($dt);
DESCRIPTION
This module understands the formats used by SQLite for its "date", "datetime" and "time" functions. It can be used to parse these formats
in order to create DateTime objects, and it can take a DateTime object and produce a timestring accepted by SQLite.
NOTE: SQLite does not have real date/time types but stores everything as strings. This module deals with the date/time strings as
understood/returned by SQLite's "date", "time", "datetime", "julianday" and "strftime" SQL functions. You will usually want to store your
dates in one of these formats.
METHODS
This class offers the methods listed below. All of the parsing methods set the returned DateTime object's time zone to the UTC zone
because SQLite does always uses UTC for date calculations. This means your dates may seem to be one day off if you convert them to local
time.
o parse_datetime($string)
Given a $string representing a date, this method will return a new "DateTime" object.
The $string may be in any of the formats understood by SQLite's "date", "time", "datetime", "julianday" and "strftime" SQL functions or
it may be in the format returned by these functions (except "strftime", of course).
The time zone for this object will always be in UTC because SQLite assumes UTC for all date calculations.
If $string contains no date, the parser assumes 2000-01-01 (just like SQLite).
If given an improperly formatted string, this method may die.
o parse_date($string)
o parse_time($string)
o parse_julianday($string)
These are aliases for "parse_datetime", for symmetry with "format_*" functions.
o format_date($datetime)
Given a "DateTime" object, this methods returnes a string in the format YYYY-MM-DD, i.e. in the same format SQLite's "date" function
uses.
o format_time($datetime)
Given a "DateTime" object, this methods returnes a string in the format HH:MM:SS, i.e. in the same format SQLite's "time" function
uses.
o format_datetime($datetime)
Given a "DateTime" object, this methods returnes a string in the format YYYY-MM-DD HH:MM:SS, i.e. in the same format SQLite's
"datetime" function uses.
o format_julianday($datetime)
Given a "DateTime" object, this methods returnes a string in the format DDDDDDDDDD, i.e. in the same format SQLite's "julianday"
function uses.
AUTHOR
Claus Faerber <CFAERBER@cpan.org>
based on "DateTime::Format::MySQL" by David Rolsky.
Copyright X 2008 Claus Faerber.
Copyright X 2003 David Rolsky.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
SEE ALSO
http://datetime.perl.org/
http://www.sqlite.org/lang_datefunc.html
perl v5.10.1 2009-12-10 DateTime::Format::SQLite(3pm)