Networker

Re: [Networker] Getting leading zeros in date and time output from mminfo? - SOLVED, mostly

2010-09-16 18:51:17
Subject: Re: [Networker] Getting leading zeros in date and time output from mminfo? - SOLVED, mostly
From: George Sinclair <George.Sinclair AT NOAA DOT GOV>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Thu, 16 Sep 2010 18:50:29 -0400
Michael Leone wrote:
On Thu, Sep 16, 2010 at 02:16:35PM -0400, Michael Leone wrote:
Now, if I could get the ssid to do the same (right align), so that

3410003144

and
928778153

both take up the same amount of space ... it means the second value
above
needs to either show leading zeros (doubtful), or print right-aligned
in
the default narrow width for ssid (which appears to be 10).
Can you post-process?  I'd just run it through a perl script to change
the alignment to what I want.

Oh, probably. But I was looking to make the columns align just using the mminfo command, from the command line, without having to post-process. I'm having to do a lot of scanning of old tapes, to re-integrate client file indexes, and got tired of not seeing a nice set of aligned columns, from a quick mminfo search. :-)

One of the things I like to do is to set my LC_TIME value on Linux to en_DK.utf8 as:

export LC_TIME=en_DK.utf8

or from a Perl script as:

$ENV{LC_TIME}='en_DK.utf8';

This formats date and time information as: YYYY-MM-DD HH:MM:SS and not YY/MM/DD HH:MM:SS, assuming 'savetime(20)'. This obviates the need to use nsavetime with mminfo command for sorting. This will allow things to sort properly by forcing mminfo to report time values beginning with year, e.g. '2008-03-26 11:19:26' as opposed to the default format, e.g. '03/26/08 11:19:26'.

But I agree, post-processing is the way to go for realignment of spacing.

George


To sign off this list, send email to listserv AT listserv.temple DOT edu and type 
"signoff networker" in the body of the email. Please write to networker-request 
AT listserv.temple DOT edu if you have any problems with this list. You can access the 
archives at http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER



--
George Sinclair
Voice: (301) 713-3284 x210
- The preceding message is personal and does not reflect any official or unofficial position of the United States Department of Commerce -
- Any opinions expressed in this message are NOT those of the US Govt. -

To sign off this list, send email to listserv AT listserv.temple DOT edu and type 
"signoff networker" in the body of the email. Please write to networker-request 
AT listserv.temple DOT edu if you have any problems with this list. You can access the 
archives at http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER