Changing CSV files with date . Subtracting date by values
Hi All,
I have a CSV file which is as below. Basically I need to take the year column in it and find if the year is >= 20152 . If that is then I should subtract all values by 6. In the below example in description I am having number mentioned as YYWW so I need to subtract those by -5. Whereever I find the year I have ti subtract by -5. If the year is >201601 then I have to subtrct by -6. The year representation is 52 week. so if the week falls on 03 for example 201403 then the subtraction of -6 will yield 201347. I am planning to do in C++ ,not sure if this possible with awk or sed.
Hi i am trying to subtract days from current date. For example todays date is 10/03/2006. If i subtract 2 days it should give 8/03/2006. I am also trying to find the access date of a file in dd/mm/yyyy format. Can any one please help in how to do this.
Ramesh (1 Reply)
I have looked through the forums and found many date / time manipulation tools, but cannot seem to find something that fits my needs for the following.
I have a log file with date time stamps like this:
Jun 21 17:21:52
Jun 21 17:24:56
Jun 21 17:27:59
Jun 21 17:31:03
Jun 21 17:34:07
Jun... (0 Replies)
Dear Expert,
Is there a command to do that in Unix?
In such a way that we don't need to actually "write" or
modified the content.
-- monkfan (4 Replies)
how can we add or subtract days from the output of date command in unix...
like if i want to subtract a day from the result of date command like this..
v_date=`date +%Y%m%d`
this wud give me 20080519
now i want to subtract one day from this.. so tht it wud give me 20080518..
how do i do... (1 Reply)
Hi all,
I'm using Red Hat Linux and want to move some folders and files around but not change the modified date. Is this possible?
I know cp has a -p flag which seems to do what I want, but this is a large volume of data so copying and deleting would not be feasible. (13 Replies)
I got a statement like below to subtract 1 from given date using teradata. I am looking for a one line unix command to perform the same.
select 'parse_this_record', (DATE '${FILE_DATE}' - 1) (FORMAT 'YYYY-MM-DD');
Input: 2012-02-21
Expected Output: 2012-02-20
PS: One liner because I am... (2 Replies)
I have a CSV file with a date format like this;
11/19/2012 17:37:00,1.372,121.6
11/19/2012 17:38:00,0.743,121.6
Want to change the time stamp to seconds after 1970 so I can get the data in rrdtool. For anyone interested, this is data from a TED5000 unit and is Kwatts and volts.
Needs to... (3 Replies)
Hi All,
I am getting a date from environment variable and want to do some processing by subtracting 2 months from the date passed through the environment variable.
I am trying the following syntax :
date_var=2014-08-31
date_2M_ago='$date_var+"%d%m%y" --$date_var="2 months ago" '... (3 Replies)
I am trying to achieve to get only the month and the day. Example Feb 5 (as you can see if it is feb 1-9) the space is 2. If it is feb 10-28, the space is only 1. I am trying to right a script that will list a directory and shoot an email if there is an activity in last 7 days. I dont really trust... (5 Replies)
Discussion started by: invinzin21
5 Replies
LEARN ABOUT DEBIAN
xcalev
XCALEV(1) General Commands Manual XCALEV(1)NAME
xcalev - load xcal calendar files with regular dates
SYNTAX
xcalev [ -r ][ -x ][ -f file ][ -d dir ][ year ]
DESCRIPTION
Xcalev is used to preload the calendar files for the xcal program with regular events in your life. It reads lines from a file (usually
called regular stored in your Calendar directory. Each line in the file contains three fields separated by spaces or tabs, these are: a
month name, a day in the month and some text. For example:
December 25 Christmas
Dec 31 New Year's Eve
The order of the month and the day are optional, the program deduces the day by looking whether the string contains an initial numeric
character or not. The year defaults to the current year unless the program is given a year number as an argument. This year cannot be
abbreviated to two digits because xcal
deals with years from year zero. There's a rough validity check on this.
The string from the data line is inserted in the appropriate file and will appear in your xcal date strip. Nothing will happen if the
string already exists in the file for that day. This means that it's safe to run xcalev at any time, only the strings that have altered in
the regular file will be updated.
To help with entering the same event for a number of days in one month, you can give a day range with a hyphen
Jan 16-21 Usenix SF
If you supply the -r option, xcalev will delete all the matching strings that it finds in the appropriate daily file. So, if you want to
make radical changes to the regular file, you should run xcalev with the -r option to remove all the current entries from one year, edit
the regular file and run xcalev to reload things.
OPTIONS
The -r option makes xcalev delete rather than append entries.
The -x option makes xcalev operate with Calendar files that are compatible with the xcalendar program.
The -f switch is followed by a filename gives an alternative name for the regular file. If the filename does not start with a slash or a
dot, then the name of your Calendar directory will be prepended to it.
The -d switch is followed by a directory name and specifies an alterative location for your Calendar directory. Your home directory is
prepended if the name doesn't start with a slash or a dot.
FILES
$HOME/Calendar/*
xc<dd><Mon><Year> A data file is day, Month in three letter format and the year.
xy<Year> A year directory.
xw<Day> A data file for the weekly code, one per day.
SEE ALSO xcal(1), xcalpr(1), xcal_cal(1)AUTHOR
Copyright 1993 by Peter Collinson, Hillside Systems All rights reserved.
X Version 11 R5 October 1993 XCALEV(1)