I have a file with some date columns in MM/DD/YYYY format:
SMPBR|DUP-DO NOT USE|NEW YORK||16105|BA5270715|6/6/2007 |MWERNER|109||||JOHN||SMITH|MD|72211118||||||74559|21 WILMINGTON RD||D|11/6/2003|SL# MD CONTACT-LIZ RICHARDS|||0|Y|N||1411458|
And I want to convert the date format to:
... (5 Replies)
In my shell script i have a variable which stores date in the format of YYYYMMDD. Is there any way to format this value to MM/DD/YYYY.
Thanks. (8 Replies)
Hello,
I am writing a script that parses different logs and produces one. In the source files, the date is in DD MM YYYY HH24:MI:SS format. In the output, it should be in DD MON YYY HH24:MI:SS (ie 25 Jan 2010 16:10:10)
To extract the dates, I am using shell substrings, i.e.:
read line
... (4 Replies)
Hi all,
i had a code where in user will enter a date in yyyymmdd format.. i didnt use any validation for the date and now the problem is if a user enters date instead of month after year it is proceeding with the code..
like if the date is 20120426 and if the user enters 20122604 it... (4 Replies)
Hi I have a problem with Date format in my code.
1st I am trying to convert today's date to yesterday's using
YESTERDAY3=`perl -e '@y=localtime(time()-86400); printf "%04d/%02d/%02d",$y+1900,$y+1,$y;$y;'`
And once it is done I am trying to using the yesterday date in a grep command to... (3 Replies)
Hi All,
I have line
,A,FDRM0002,12/21/2017,,0.961751583,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
it contains date in mm/dd/yyyy format i want to change this to yyyymmdd format using perl.
Use code tags, thanks. (8 Replies)
Hi All
I need help in converting a string of YYYYMMDD format to date in Sun OS and then find out if the day is a Wednesday or not. The "date -d" option is not working and your help is much appreciated.
The date command usage from the operating system we use here is as follows:
usage: ... (1 Reply)
Hi All
I need help in converting a string of YYYYMMDD format to date in Sun OS and then find out if the day is a Wednesday or not. The "date -d" option is not working and your help is much appreciated.
The date command usage from the operating system we use here is as follows:
Thanks,
SK (11 Replies)
Discussion started by: SK123
11 Replies
LEARN ABOUT LINUX
dpkg::substvars
Dpkg::Substvars(3) libdpkg-perl Dpkg::Substvars(3)NAME
Dpkg::Substvars - handle variable substitution in strings
DESCRIPTION
It provides some an object which is able to substitute variables in strings.
METHODS
my $s = Dpkg::Substvars->new($file)
Create a new object that can do substitutions. By default it contains generic substitutions like ${Newline}, ${Space}, ${Tab},
${dpkg:Version} and ${dpkg:Upstream-Version}.
Additional substitutions will be read from the $file passed as parameter.
It keeps track of which substitutions were actually used (only counting substvars(), not get()), and warns about unused substvars
when asked to. The substitutions that are always present are not included in these warnings.
$s->set($key, $value)
Add/replace a substitution.
$s->get($key)
Get the value of a given substitution.
$s->delete($key)
Remove a given substitution.
$s->no_warn($key)
Prevents warnings about a unused substitution, for example if it is provided by default.
$s->load($file)
Add new substitutions read from $file.
$s->parse($fh, $desc)
Add new substitutions read from the filehandle. $desc is used to identify the filehandle in error messages.
$s->set_version_substvars($version)
Defines ${binary:Version}, ${source:Version} and ${source:Upstream-Version} based on the given version string.
These will never be warned about when unused.
$s->set_arch_substvars()
Defines architecture variables: ${Arch}.
This will never be warned about when unused.
$newstring = $s->substvars($string)
Substitutes variables in $string and return the result in $newstring.
$s->warn_about_unused()
Issues warning about any variables that were set, but not used
$s->set_msg_prefix($prefix)
Define a prefix displayed before all warnings/error messages output by the module.
$s->save($file)
Store all substitutions variables except the automatic ones in the indicated file.
"$s" Return a string representation of all substitutions variables except the automatic ones.
$str = $s->output($fh)
Print all substitutions variables except the automatic ones in the filehandle and return the content written.
AUTHOR
Raphael Hertzog <hertzog@debian.org>.
1.16.0.3 2012-04-17 Dpkg::Substvars(3)