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
mp3::tag::cddb_file
MP3::Tag::CDDB_File(3pm) User Contributed Perl Documentation MP3::Tag::CDDB_File(3pm)NAME
MP3::Tag::CDDB_File - Module for parsing CDDB files.
SYNOPSIS
my $db = MP3::Tag::CDDB_File->new($filename, $track); # Name of audio file
my $db = MP3::Tag::CDDB_File->new_from($record, $track); # Contents of CDDB
($title, $artist, $album, $year, $comment, $track) = $db->parse();
see MP3::Tag
DESCRIPTION
MP3::Tag::CDDB_File is designed to be called from the MP3::Tag module.
It parses the content of CDDB file.
The file is found in the same directory as audio file; the list of possible file names is taken from the field "cddb_files" if set by
MP3::Tag config() method.
parse()
($title, $artist, $album, $year, $comment, $track) =
$db->parse($what);
parse_filename() extracts information about artist, title, track number, album and year from the CDDB record. $what is optional; it
maybe title, track, artist, album, year, genre or comment. If $what is defined parse() will return only this element.
Additionally, $what can take values "artist_collection" (returns the value of artist in the disk-info field DTITLE, but only if author
is specified in the track-info field TTITLE), "title_track" (returns the title specifically from track-info field - the "track" may
fall back to the info from disk-info field), "comment_collection" (processed EXTD comment), "comment_track" (processed EXTT comment).
The returned year and genre is taken from DYEAR, DGENRE, EXTT, EXTD fields; recognized prefixes in the two last fields are YEAR, ID3Y,
ID3G. The declarations of this form are stripped from the returned comment.
An alternative syntax "Recorded"/"Recorded on"/"Recorded in"/ is also supported; the format of the date recognized by ID3v2::year(), or
just a date field without a prefix.
title()
$title = $db->title();
Returns the title, obtained from the 'Tracktitle' entry of the file.
artist()
$artist = $db->artist();
Returns the artist name, obtained from the 'Performer' or 'Albumperformer' entries (the first which is present) of the file.
track()
$track = $db->track();
Returns the track number, stored during object creation, or queried from the parent.
year()
$year = $db->year();
Returns the year, obtained from the 'Year' entry of the file. (Often not present.)
album()
$album = $db->album();
Returns the album name, obtained from the 'Albumtitle' entry of the file.
comment()
$comment = $db->comment();
Returns the 'Trackcomment' entry of the file. (Often not present.)
genre()
$genre = $db->genre($filename);
perl v5.14.2 2009-04-15 MP3::Tag::CDDB_File(3pm)