How would I strip a date field? For example, if I have
TODAY defined as the following: TODAY=`date +"%m/%d/%y"`,
TODAY is assigned the value 11/01/03 on Nov 1, 2003
How would I strip the first 2 bytes? (11)?
Thank you in advance for the help. (6 Replies)
I get the perl date in the following format:
Mon Jan 31 06:01:37 2005
How can I extract each field in a single line using a regular expression??
I dont want to use "split".
Any other way out??
JP :) (2 Replies)
I'm working on formatting some attendance data to meet a vendors requirements to upload to their system. With some help on the forums here, I have the data close. But they've since changed what they want.
The vendor wants me to submit three fields to them. Field 1 is the studentid field,... (4 Replies)
Hi All,
I am looking for an awk script to do the following
Join the fields together only if the first 4 fields are same.
Can it be done with join function in awk??
a,b,c,d,8,,,
a,b,c,d,,7,,
a,b,c,d,,,9,
a,b,p,e,8,,,
a.b,p,e,,9,,
a,b,p,z,,,,9
a,b,p,z,,8,,
desired output:
... (1 Reply)
Hi experts,
I need to print the first field first then last two fields should come next and then i need to print rest of the fields.
Input :
a1,abc,jsd,fhf,fkk,b1,b2
a2,acb,dfg,ghj,b3,c4
a3,djf,wdjg,fkg,dff,ggk,d4,d5
Expected output:
a1,b1,b2,abc,jsd,fhf,fkk... (6 Replies)
I'm trying to compare 2 files for differences in a selct number of fields. When differnces are found it will write the whole record of the second file including appending '|C' out to a delta file. Each record will have 20 fields, but only want to do comparison of 1st 15 fields. The 1st field of... (7 Replies)
Hi all,
I have a file with a list of rpm's that have different dates. I am trying to just grab the latest rpm and install date, and discard the rest. The file has 1000's of entries all with different names and dates.
I have tried sort -k on the file and I am not grabbing the info,
... (4 Replies)
Hi
I have a file as below
<field1> <field2> <field3> ... <field_num1> <field_num2>
Trying to sort based on difference of <field_num1> and <field_num2> in desceding order and print all fields.
I tried this and it doesn't sort on the difference field .. Appreciate your help.
cat... (9 Replies)
Hi,
I have a script doing backup to synology server, the script create new folder each day with the date as being folder name i.e. 2018-07-30. Just before creating the new folder I want the script to find the oldest folder from the list and delete it including its content.
for example... (3 Replies)
I am trying to work on a script where it is a *(star) delimited file has a multiple lines starts with RTG and 3rd column=TD8 I want to substring the date part and
I want to replace with currentdate minus 15 days. Here is an example. iam using AIX server
$ cat temp.txt
RTG*888*TD8*20180201~... (1 Reply)
Discussion started by: Shankar455
1 Replies
LEARN ABOUT CENTOS
pmparsectime
PMPARSECTIME(3) Library Functions Manual PMPARSECTIME(3)NAME
__pmParseCtime - convert ctime(3) string to tm structure
C SYNOPSIS
#include <pcp/pmapi.h>
#include <pcp/impl.h>
int __pmParseCtime(const char *string, struct tm *rslt, char **errmsg);
cc ... -lpcp
DESCRIPTION
__pmParseCtime reverses the asctime(3C) function. It accepts a string specifying a time, and fills in the given tm structure.
Either a fully specified asctime(3C) string like "Mon Mar 4 13:07:47 1996" or a partially specified time like '1996", "Mar 1996", "Mar 4
1996", "Mar", "13:07:47", "13:07", "Mar 4 13:07:47",... is accepted. In addition, the seconds component may be a floating point number,
for example "13:07:47.5". The 12 hour clock is also supported, so "13:07" and "1:07 pm" are equivalent.
__pmParseCtime returns 0 if successful. It returns -1 and a dynamically allocated error message string in errmsg, if the given string does
not parse. Be sure to free(3C) the error message string.
The tm structure returned in rslt should only be used as an argument to the __pmConvertTime function, as it contains encoded information
that will only be correctly interpreted by __pmConvertTime.
SEE ALSO PMAPI(3), pmParseInterval(3), __pmConvertTime(3) and __pmParseTime(3).
Performance Co-Pilot PCP PMPARSECTIME(3)