Sponsored Content
Top Forums Shell Programming and Scripting Valid separator in time and date format Post 303035841 by Chubler_XL on Tuesday 4th of June 2019 07:54:28 PM
Old 06-04-2019
I think the way to tackle this problem is to start by converting the format string to a RE with named groups e.g %m-%d-%y would become (?<d>\d\d)-(?<m>\d\d)-(?<Y>\d{4})

There are still locale issues as %a would become (?<a>Mon|Tue|Wed|Thu|Fri|Sat|Sun) in English locals but (?<a>Lun|Mar|Mer|Jeu|Ven|Sam|Dim) in French locals.

Once this is done if a string matches the RE you can then pull out the named group values and verify they go together correctly e.g that a=Tue is correct for d=4 m=6 Y=2019.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

format date/time presentation

1) i am trying to print the timeframe of a log file using the start/end date/time being extracted from the file itself. my problem is how to convert the following numeric date format to the one that i prefer: Start time: 0204161129 End time : 0204171431 into: Start time: Apr 16 2002... (6 Replies)
Discussion started by: apalex
6 Replies

2. Shell Programming and Scripting

Convert Epoch time format to normal date time format in the same file

I have a file named "suspected" with series of line like these : {'protocol': 17, 'service': 'BitTorrent KRPC', 'server': '219.78.120.166', 'client_port': 52044, 'client': '10.64.68.44', 'server_port': 8291, 'time': 1226506312L, 'serverhostname': ''} {'protocol': 17, 'service': 'BitTorrent... (3 Replies)
Discussion started by: rk4k
3 Replies

3. Shell Programming and Scripting

Date and Time format

I want to append current date and time to a file name like filename_090920091210. If I use filename_`date +%d%m%Y%T`, the ouput is filename_0909200912:10:33. How to format this as filename_090920091210. Please let me know. Thanks in advance. (3 Replies)
Discussion started by: srimenon09
3 Replies

4. Shell Programming and Scripting

date and time in mm/dd/yyyy hh:mm format

Frens, I have a logfile which has got manier things in it and somewer in that file i have a date in mm/dd/yyyy hh:mm format.... I just need to get the date and time nothing else.... i have searched in this forum for it but got only date in mm-dd-yyyy format.. but i need to search for... (10 Replies)
Discussion started by: smarty86
10 Replies

5. Shell Programming and Scripting

awk & date time format

This gives: grep "qprt -o -dp -N 1 -P" printfile.log.1216 |awk '{print $7, $9}' |grep lpc1z The output like below: lpc1z /cerner/d_prod/print/ccltemp4235396d030a.dat.tmp.1216075330] lpc1z /cerner/d_prod/print/ccltemp4235396d036a.dat.tmp.1216075634] lpc1z... (2 Replies)
Discussion started by: Daniel Gate
2 Replies

6. UNIX for Dummies Questions & Answers

Shell Scripts - shows today’s date and time in a better format than ‘date’ (Uses positional paramete

Hello, I am trying to show today's date and time in a better format than ‘date' (Using positional parameters). I found a command mktime and am wondering if this is the best command to use or will this also show me the time elapse since 1/30/70? Any help would be greatly appreciated, Thanks... (3 Replies)
Discussion started by: citizencro
3 Replies

7. Shell Programming and Scripting

Military type format date/time conversion

Hello All, I have a requirement to convert a 12 hour format to 24 hour time format and the sample input /out put is below Input Time format : Nov 2 2011 12:16AM Out Put Format : Nov 2 2011 0:16 Input : Nov 2 2011 4:16PM Out Put: Nov 2 2011 16:16 I have done this using a... (6 Replies)
Discussion started by: jambesh
6 Replies

8. HP-UX

DATE and TIME format help in HP-UX

Hello, I have date format as shown in red color below Fri, Sep 12, 2012 08:38:05 PM Can anyone help me with command to change this format to yyyy-mm-dd and HH:MM:SS Note: Time should be in 24 hours format I really appreciate your help!! Thanks, Elavarasan (4 Replies)
Discussion started by: Elavarasan
4 Replies

9. Shell Programming and Scripting

Change the date and time format in UNIX script.

Hi, I am extracting a date string from the source file like this : 06/05/2014 16:04:00 I want to change it to 05-JUN-14 04.05.00.000000000 PM I basically store the date in a variable. I got solutions to change date in dd-mmm-yyyy format using tr but I guess it works only with the "date"... (8 Replies)
Discussion started by: Varshha
8 Replies

10. Shell Programming and Scripting

Check if time format is valid

How can I validate if time (HH:MM:SS) argument is valid? I got this from web but I can't modify it to exit the script if the time argument is invalid. echo $1 | awk -F ':' '{ print ($1 <= 23 && $2 <= 59 && $3 <= 59) ? "good" : "bad" }' ex: ./script.ksh 12:34:21 = okay ./script.ksh... (10 Replies)
Discussion started by: erin00
10 Replies
Bio::Structure::Atom(3pm)				User Contributed Perl Documentation				 Bio::Structure::Atom(3pm)

NAME
Bio::Structure::Atom - Bioperl structure Object, describes an Atom SYNOPSIS
#add synopsis here DESCRIPTION
This object stores a Bio::Structure::Atom FEEDBACK
Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists Support Please direct usage questions or support issues to the mailing list: bioperl-l@bioperl.org rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR - Kris Boulez Email kris.boulez@algonomics.com APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ new() Title : new() Usage : $struc = Bio::Structure::Atom->new( -id => 'human_id', ); Function: Returns a new Bio::Structure::Atom object from basic constructors. Probably most called from Bio::Structure::IO. Returns : a new Bio::Structure::Atom object x() Title : x Usage : $x = $atom->x($x); Function: Set/gets the X coordinate for an Atom Returns : The value for the X coordinate of the Atom (This is just a number, it is expected to be in Angstrom, but no garantees) Args : The X coordinate as a number y() Title : y Usage : $y = $atom->y($y); Function: Set/gets the Y coordinate for an Atom Returns : The value for the Y coordinate of the Atom (This is just a number, it is eypected to be in Angstrom, but no garantees) Args : The Y coordinate as a number z() Title : z Usage : $z = $atom->z($z); Function: Set/gets the Z coordinate for an Atom Returns : The value for the Z coordinate of the Atom (This is just a number, it is ezpected to be in Angstrom, but no garantees) Args : The Z coordinate as a number xyz() Title : xyz Usage : ($x,$y,$z) = $atom->xyz; Function: Gets the XYZ coordinates for an Atom Returns : A list with the value for the XYZ coordinate of the Atom Args : residue() Title : residue Usage : Function: No code here, all parent/child stuff via Entry Returns : Args : icode() Title : icode Usage : $icode = $atom->icode($icode) Function: Sets/gets the icode Returns : Returns the icode for this atom Args : reference to an Atom serial() Title : serial Usage : $serial = $atom->serial($serial) Function: Sets/gets the serial number Returns : Returns the serial number for this atom Args : reference to an Atom occupancy() Title : occupancy Usage : $occupancy = $atom->occupancy($occupancy) Function: Sets/gets the occupancy Returns : Returns the occupancy for this atom Args : reference to an Atom tempfactor() Title : tempfactor Usage : $tempfactor = $atom->tempfactor($tempfactor) Function: Sets/gets the tempfactor Returns : Returns the tempfactor for this atom Args : reference to an Atom segID() Title : segID Usage : $segID = $atom->segID($segID) Function: Sets/gets the segID Returns : Returns the segID for this atom Args : reference to an Atom pdb_atomname() Title : pdb_atomname Usage : $pdb_atomname = $atom->pdb_atomname($pdb_atomname) Function: Sets/gets the pdb_atomname (atomname used in the PDB file) Returns : Returns the pdb_atomname for this atom Args : reference to an Atom element() Title : element Usage : $element = $atom->element($element) Function: Sets/gets the element Returns : Returns the element for this atom Args : reference to an Atom charge() Title : charge Usage : $charge = $atom->charge($charge) Function: Sets/gets the charge Returns : Returns the charge for this atom Args : reference to an Atom sigx() Title : sigx Usage : $sigx = $atom->sigx($sigx) Function: Sets/gets the sigx Returns : Returns the sigx for this atom Args : reference to an Atom sigy() Title : sigy Usage : $sigy = $atom->sigy($sigy) Function: Sets/gets the sigy Returns : Returns the sigy for this atom Args : reference to an Atom sigz() Title : sigz Usage : $sigz = $atom->sigz($sigz) Function: Sets/gets the sigz Returns : Returns the sigz for this atom Args : reference to an Atom sigocc() Title : sigocc Usage : $sigocc = $atom->sigocc($sigocc) Function: Sets/gets the sigocc Returns : Returns the sigocc for this atom Args : reference to an Atom sigtemp() Title : sigtemp Usage : $sigtemp = $atom->sigtemp($sigtemp) Function: Sets/gets the sigtemp Returns : Returns the sigtemp for this atom Args : reference to an Atom aniso() Title : aniso Usage : $u12 = $atom->aniso("u12", $u12) Function: Sets/gets the anisotropic temperature factors Returns : Returns the requested factor for this atom Args : reference to an Atom, name of the factor, value for the factor id() Title : id Usage : $atom->id("CZ2") Function: Gets/sets the ID for this atom Returns : the ID Args : the ID _remove_residue() Title : _remove_residue Usage : Function: Removes the Residue this Atom is atttached to. Returns : Args : _grandparent() Title : _grandparent Usage : Function: get/set a symbolic reference to our grandparent Returns : Args : perl v5.14.2 2012-03-02 Bio::Structure::Atom(3pm)
All times are GMT -4. The time now is 02:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy