07-11-2014
Quote:
Originally Posted by
Corona688
So you want to fast-forward to 'friday' so if the year changes, it becomes the first week?
Saturday actually. However there will be years in which my method and the AWK methods cut the years differently. It won't happen in all years, but some of them.
Mike
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have an excel file that have a random count of columns/fields and what im trying to do is to only retrieve all the rows under 2 specific field headers.
I can use the usually command for awk which is awk 'print{ $1 $2}' > output.txt, but the location of the 2 specific field headers is... (9 Replies)
Discussion started by: mdap
9 Replies
2. Shell Programming and Scripting
Hi,
I am trying to find a way to read an excel work book with multiple worksheets.
And write each worksheet into a new excel file using perl. My environment is Unix.
For example: I have an excel workbook TEST.xls and it has Sheet1, Sheet2, Sheet3 worksheets. I would like to create... (2 Replies)
Discussion started by: sandeep78
2 Replies
3. Shell Programming and Scripting
hi guys, i would like to print two lines from a file as two adjacent columns using excel using awk.. i have this so far:
awk '{for(i=1; i<=NF; i++) {printf("%s\n",$i)}}' "$count".ttt > "$count".csv #this to print the first line from the .ttt file as rows of the first column in the .csv... (9 Replies)
Discussion started by: npatwardhan
9 Replies
4. Shell Programming and Scripting
Hi
I have 2 csv files which looks like the following and i have to compare the 2 CSVs and create a third file such that if the value of the 1st cell in A.CSV and the value of the first cell in the B.CSV are same, it should print "SAME" in the third file or else print NOT SAME. Likewise i need... (19 Replies)
Discussion started by: meva
19 Replies
5. UNIX for Dummies Questions & Answers
I've looked at a few different posts and none have entirely answered my question.
Wondering how i'd go about using AWK to export to an excel file, which i gather would be a .csv file from what I've read.
Atm my AWK command will read 2 files and export 2 files. Each of those files have 2... (3 Replies)
Discussion started by: Aussiemick
3 Replies
6. Shell Programming and Scripting
I am new to scripting/programming, so I apologize for any novice questions.
I have a tab delimited text file that was saved from excel xls file.
I am trying to select only the third column using awk command. My command line is as below:
cat test.txt | awk '{print $3}'
However, above... (8 Replies)
Discussion started by: SangLad
8 Replies
7. Shell Programming and Scripting
All,
I have an excel sheet Excel1.xls that has some entries.
I have one more excel sheet Excel2.xls that has entries only in those cells which are blank in Excel1.xls
These may be in different workbooks. They are totally independent made by 2 different users.
I have placed them in a... (1 Reply)
Discussion started by: Anamika08
1 Replies
8. UNIX for Advanced & Expert Users
Hi,
I need extract / transpose where "Y" in the input file
My input file is
Item,EB,SB,SD,TP,GR
LP,Y,N,N,N,Y
GC,Y,N,N,N,N
CO,N,Y,Y,Y,Y
PS,Y,N,N,Y,Y
Expecting output is
EB-/'LP/',/'GC/',/'PS/'
SB-/'CO/'
SD-/'CO/'
TP-/'CO/',/'PS/'
GR-LP,CO,PS
I appreciate for your help
Regards (4 Replies)
Discussion started by: myrole
4 Replies
9. Shell Programming and Scripting
Hi ,
i am generating some data by firing sql query with connecting to the database by my solaris box.
The below one should be the header line of my excel ,here its coming in separate row.
TO_CHAR(C. CURR_EMP_NO
---------- ---------------
LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies
10. Shell Programming and Scripting
I have two files
File1
175552 st_497858.1 rs86052.1 rs92185.1 st_001022416.1 174841 175552_174841
179912 st_001122967.2 rs90435.1 rs89122.1 st_001022583.1 175545 179912_175545
179912 st_001122967.2 rs90435.1 rs89122.1 st_001022584.1 175545 179912_175545
179967 st_001256606.1 rs93516.2... (1 Reply)
Discussion started by: sammy777888
1 Replies
LEARN ABOUT NETBSD
parsedate
PARSEDATE(3) BSD Library Functions Manual PARSEDATE(3)
NAME
parsedate -- date parsing function
LIBRARY
System Utilities Library (libutil, -lutil)
SYNOPSIS
#include <util.h>
time_t
parsedate(const char *datestr, const time_t *time, const int *tzoff);
DESCRIPTION
The parsedate() function parses a datetime from datestr described in english relative to an optional time point and an optional timezone off-
set in seconds specified in tzoff. If either time or tzoff are NULL, then the current time and timezone offset are used.
The datestr is a sequence of white-space separated items. The white-space is optional the concatenated items are not ambiguous. An empty
datestr is equivalent to midnight today (the beginning of this day).
The following words have the indicated numeric meanings: last = -1, this = 0, first, next, or one = 1, second is unused so that it is not
confused with ``seconds'', two = 2, third or three = 3, fourth or four = 4, fifth or five = 5, sixth or six = 6, seventh or seven = 7, eighth
or eight = 8, ninth or nine = 9, tenth or ten = 10, eleventh or eleven = 11, twelfth or twoelve = 12.
The following words are recognized in English only: AM, PM, a.m., p.m.
The months: january, february, march, april, may, june, july, august, september, sept, october, november, december,
The days of the week: sunday, monday, tuesday, tues, wednesday, wednes, thursday, thur, thurs, friday, saturday.
Time units: year, month, fortnight, week, day, hour, minute, min, second, sec, tomorrow, yesterday.
Timezone names: gmt, ut, utc, wet, bst, wat, at, ast, adt, est, edt, cst, cdt, mst, mdt, pst, pdt, yst, ydt, hst, hdt, cat, ahst, nt, idlw,
cet, met, mewt, mest, swt, sst, fwt, fst, eet, bt, zp4, zp5, zp6, wast, wadt, cct, jst, east, eadt, gst, nzt, nzst, nzdt, idle.
A variety of unambiguous dates are recognized:
69-09-10 For years between 69-99 we assume 1900+ and for years between 0-68 we assume 2000+.
2006-11-17 An ISO-8601 date.
10/1/2000 October 10, 2000; the common US format.
20 Jun 1994
23jun2001
1-sep-06 Other common abbreviations.
1/11 the year can be omitted
As well as times:
10:01
10:12pm
12:11:01.000012
12:21-0500
Relative items are also supported:
-1 month
last friday
one week ago
this thursday
next sunday
+2 years
Seconds since epoch (also known as UNIX time) are also supported:
@735275209 Tue Apr 20 03:06:49 UTC 1993
RETURN VALUES
parsedate() returns the number of seconds passed since the Epoch, or -1 if the date could not be parsed properly.
SEE ALSO
date(1), eeprom(8)
HISTORY
The parser used in parsedate() was originally written by Steven M. Bellovin while at the University of North Carolina at Chapel Hill. It was
later tweaked by a couple of people on Usenet. Completely overhauled by Rich $alz and Jim Berets in August, 1990.
The parsedate() function first appeared in NetBSD 4.0.
BUGS
1
The parsedate() function is not re-entrant or thread-safe.
2
The parsedate() function cannot compute days before the unix epoch (19700101).
3
The parsedate() function assumes years less than 0 mean - year, years less than 70 mean 2000 + year, years less than 100 mean 1900 + year.
BSD
December 20, 2010 BSD