03-18-2011
It worked.
Thanks for a clean and easy to understand solution
Thanks a lot.
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I need to capture a file's creation/modification date and time and convert this to a different format, whilst I can easily get the existing format from a ls -l | awk ' { print $......}' or a cut command I do not know how to convert it to a desired format?
I should add that at present the ls -l... (1 Reply)
Discussion started by: barney_clough
1 Replies
2. Shell Programming and Scripting
Hi
Please anyone to help to write script to convert date to 'yyyy-mm-dd'(If column is date convert) because my file has large and lot of date colums.
If file is small ,using awk command to achive.
cat file1|awk 'BEGIN {FS=OFS='|'}... (7 Replies)
Discussion started by: mohan705
7 Replies
3. Shell Programming and Scripting
I have a comma delimited log file which has the date as MM/DD/YY in the 2nd column, and HH:MM:SS in the 3rd column.
I need to change the date format to YYYY-MM-DD and merge it with the the time HH:MM:SS. How will I got about this?
Sample input
02/27/09,23:52:31
02/27/09,23:52:52... (3 Replies)
Discussion started by: hazno
3 Replies
4. Shell Programming and Scripting
Hi,
I am having couple of files which i used to copy from windows to Linux, so now in case of text files (CTRL^M) appears at end of line. I know i can convert this windows format file to unix format file by running dos2unix.
My requirement here is that i want to do it automatically using a... (5 Replies)
Discussion started by: sarbjit
5 Replies
5. UNIX for Advanced & Expert Users
Hi All,
I am new to this forum, could any one help me out in resolving the below issue.
Input of the flat file contains several lines of text for example find below:
5022090,2,4,7154,88,,,,,4/1/2011 0:00,Z,L,2
5022090,3,1,6648,88,,,,,4/1/2011 0:00,Z,,1... (0 Replies)
Discussion started by: av_sagar
0 Replies
6. Shell Programming and Scripting
Hi All,
I am new to this forum. Could anyone help me to resolve the following issue.
Input of the flat file contains several lines of text for example find below:
5022090,2,4,7154,88,,,,,4/1/2011 0:00,Z,L,2
5022090,3,1,6648,88,,,,,4/1/2011 0:00,Z,,1
5022090,4,1,6648,88,,,,,4/1/2011... (6 Replies)
Discussion started by: av_sagar
6 Replies
7. Shell Programming and Scripting
Dear all,
I have 2 questions.
I have a file with many rows which has date of the format YYYYMMDD.
1. I need to change the date to that weeks friday date(Ex: 20120716(monday) to 20120720). Satuday/Sunday has to be changed to next week friday date too.
2. After converting the date to... (10 Replies)
Discussion started by: 2001.arun
10 Replies
8. UNIX for Dummies Questions & Answers
Hi Unix Gurus,
I would like to rename several files in a Unix Directory . The filenames can have more than 1 underscore ( _ ) and the last underscore is always followed by a date in the format mmddyyyy. The Extension of the files can be .txt or .pdf or .xls etc and is case insensitive ie... (1 Reply)
Discussion started by: pchegoor
1 Replies
9. Shell Programming and Scripting
Hi
i try to change the date-format from DD/MM/YYYY into MM/DD/YY.
Input-Data:
...
31/12/2013,23:40,198.00,6.20,2,2,2,1,11580.0,222
31/12/2013,23:50,209.00,7.30,2,2,3,0,4380.0
01/01/2014,00:00,205.90,8.30,2,2,3,1,9360.0,223
...
Output-Data should be:
...... (7 Replies)
Discussion started by: IMPe
7 Replies
LEARN ABOUT DEBIAN
namespace::autoclean
namespace::autoclean(3pm) User Contributed Perl Documentation namespace::autoclean(3pm)
NAME
namespace::autoclean - Keep imports out of your namespace
SYNOPSIS
package Foo;
use namespace::autoclean;
use Some::Package qw/imported_function/;
sub bar { imported_function('stuff') }
# later on:
Foo->bar; # works
Foo->imported_function; # will fail. imported_function got cleaned after compilation
DESCRIPTION
When you import a function into a Perl package, it will naturally also be available as a method.
The "namespace::autoclean" pragma will remove all imported symbols at the end of the current package's compile cycle. Functions called in
the package itself will still be bound by their name, but they won't show up as methods on your class or instances.
This module is very similar to namespace::clean, except it will clean all imported functions, no matter if you imported them before or
after you "use"d the pragma. It will also not touch anything that looks like a method, according to "Class::MOP::Class::get_method_list".
If you're writing an exporter and you want to clean up after yourself (and your peers), you can use the "-cleanee" switch to specify what
package to clean:
package My::MooseX::namespace::autoclean;
use strict;
use namespace::autoclean (); # no cleanup, just load
sub import {
namespace::autoclean->import(
-cleanee => scalar(caller),
);
}
PARAMETERS
-also => [ ITEM | REGEX | SUB, .. ]
-also => ITEM
-also => REGEX
-also => SUB
Sometimes you don't want to clean imports only, but also helper functions you're using in your methods. The "-also" switch can be used to
declare a list of functions that should be removed additional to any imports:
use namespace::autoclean -also => ['some_function', 'another_function'];
If only one function needs to be additionally cleaned the "-also" switch also accepts a plain string:
use namespace::autoclean -also => 'some_function';
In some situations, you may wish for a more powerful cleaning solution.
The "-also" switch can take a Regex or a CodeRef to match against local function names to clean.
use namespace::autoclean -also => qr/^_/
use namespace::autoclean -also => sub { $_ =~ m{^_} };
use namespace::autoclean -also => [qr/^_/ , qr/^hidden_/ ];
use namespace::autoclean -also => [sub { $_ =~ m/^_/ or $_ =~ m/^hidden/ }, sub { uc($_) == $_ } ];
SEE ALSO
namespace::clean
Class::MOP
B::Hooks::EndOfScope
AUTHOR
Florian Ragwitz <rafl@debian.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Florian Ragwitz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.12.4 2011-08-24 namespace::autoclean(3pm)