07-11-2014
If you really want to go to a lot of trouble, run localedef -
read the localdef man file for your system, get a series of localedef inputfiles (on Linux usually /usr/share/I18n...). Piddle around with the time and calendar file. Use YOUR locale files, change a few things, compile the files with localedef, use a unique output name for your locale. Or break your system. Put the compiled file wherever it needs to go (localedef man page). Run your code pretty much without all the gobbledygook about week start. Instead set your locale to the modified one as the first line of a shell script - then run awk code. Underlying the awk interpreter is C code which speaks locale.
I've had to do this for some calendrics I did a long time ago. It is highly OS specific.
Since it appears you are doing this on a Linux box (GNU gawk probably! Because POSIX awk does not do date/time C calls like mktime), I am not in a position to make more explicit suggestions.
Last edited by jim mcnamara; 07-11-2014 at 10:17 PM..
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 DEBIAN
lire::weekcalculator
WeekCalculator(3pm) LogReport's Lire Documentation WeekCalculator(3pm)
NAME
Lire::WeekCalculator - handle different weeknumbering schemes
SYNOPSIS
use Lire::WeekCalculator;
my $week_calc = new Lire::WeekCalculator();
my $week_no = $week_calc->week_number( $time );
DESCRIPTION
We support three values for LR_WEEK_NUMBERING: ISO (strftime's %V): week starts on monday; W (week starts on monday) and U (week starts on
sunday). See strftime(1).
CONSTRUCTOR
new( %params )
Creates a new week calculator. The style of week numbering is selected using the "style" parameter. If that parameter is omitted, it
defaults to the style set in 'lr_week_numbering' configuration variable.
style()
Returns the week numbering style used. This will be either "U", "W" or "ISO".
week_number( $time )
Returns the week number of $time according the current week numbering scheme. The week number returned is between 1 and 53.
week_idx( $time )
Returns the week index of $time according to the week numbering scheme. The week index is Lire specific and is used to normalise
computations between different scheme in regards of the first incomplete week of the year. In the ISO case, the week index is always equals
to week_number() - 1, for the other style, the week index of the week 0 will be one less than the last week number of the previous year.
last_week_of_year($year)
Returns the week number of the last week in the year $year.
week_start( $year, $week_no )
Returns the epoch time of the first day of week $week_no in year $year when calculated using current style.
find_year_week1_start_date($year)
Returns the date (epoch) at which the first day of the first week of the year $year starts.
strformat()
Returns a string that can be used as the format specificier in calls to strftime to print the week number of this style.
strfdate()
Emulates POSIX::strftime() but picks up the %V if the system strftime doesn't support it. Should be called whenever you use format strings
that may contain week-of-the-year-codes.
AUTHORS
Joost van Baal <joostvb@logreport.org>,
Francis J. Lacoste <flacoste@logreport.org>,
Wessel Dankers <wsl@logreport.org>
VERSION
$Id: WeekCalculator.pm,v 1.16 2006/07/23 13:16:30 vanbaal Exp $
COPYRIGHT
Copyright (C) 2002 Stichting LogReport Foundation LogReport@LogReport.org
This file is part of Lire.
Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with
http://www.gnu.org/copyleft/gpl.html.
Lire 2.1.1 2006-07-23 WeekCalculator(3pm)