Extract Date part from the filename


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Extract Date part from the filename
Prev   Next
# 1  
Old 04-01-2014
Extract Date part from the filename

Hi All,

I have incoming source files abcmmyy.txt I need to extract the mmyy part from the filename and pass that to a variable . I really appreciate your quick response on this.

Thanks
raj
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Extract date and time part from filename

Hi, I am facing one scenario in which I need to extract exact position of date and time from the name of the files. For example, Below is the record in which I need to extract position of YYYYMMDD,HHMISS and YYMMDD. Date and time variables can come more than once. I need to use these position... (13 Replies)
Discussion started by: Prathmesh
13 Replies

2. UNIX for Beginners Questions & Answers

How to extract date and time from filename?

Hi, I'm totally new in sell script and working with a shell code. I want to extract the date and time from the filenames. The filenames are different but all of them begins with WI_ SCOPE_: WI_SCOPE_DATA_CHANGE_2017-09-12_15-30-40.txt WI_SCOPE_BACK_COMPLETE_QUEUE_2017-09-12_15-31-40.txt... (5 Replies)
Discussion started by: Home
5 Replies

3. Shell Programming and Scripting

Finding the part of a filename

Hi, I am writing an ebuild for Gentoo Linux operating system. Writing an ebuild is about Bash scripting where I am a newbie. So, my ebuild must find a part of a specific filename. Such a filaname my look like this: libvclient_release_x64.so.740and I must to find the number at the and of... (18 Replies)
Discussion started by: csanyipal
18 Replies

4. Shell Programming and Scripting

Extract a part of a filename containing a particular word

Hi All, Thanks in Advance Shell Script or Perl Script I am working on a shell script. I need some assistance. My Requirement: 1) There are some set of files in a directory like given below OTP_UFSC_20120530000000_acc.csv OTP_UFSC_20120530000000_faf.csv... (7 Replies)
Discussion started by: aealexanderraj
7 Replies

5. Programming

to extract all the part of the filename before a particular word in the filename

Hi All, Thanks in Advance I am working on a shell script. I need some assistance. My code: if then set "subscriber" "promplan" "mapping" "dedicatedaccount" "faflistSub" "faflistAcc" "accumulator"\ "pam_account"; for i in 1 2 3 4 5 6 7 8;... (0 Replies)
Discussion started by: aealexanderraj
0 Replies

6. UNIX for Dummies Questions & Answers

to extract all the part of the filename before a particular word in the filename

Hi All, Thanks in Advance I am working on a shell script. I need some assistance. My Requirement: 1) There are some set of files in a directory like given below OTP_UFSC_20120530000000_acc.csv OTP_UFSC_20120530000000_faf.csv OTP_UFSC_20120530000000_prom.csv... (0 Replies)
Discussion started by: aealexanderraj
0 Replies

7. Shell Programming and Scripting

Getting part of a filename

Hi All, I'm trying to get part of a filename and my skill with regular expression are lacking. I know I need to use SED but have no idea how to use it. I'm hoping that someone can help me out. The file names would be: prefix<partwewant>suffix.extension the prefix and suffix are always 3... (4 Replies)
Discussion started by: imonkey
4 Replies

8. Shell Programming and Scripting

Extract date from filename and set timestamp

I have lots of files in this format: dvgrab-2003.06.29_15-30-24.mpg The numbers represents the date and time (YYYY.MM.DD_HH-MM-SS) How can I extract the dates from the filenames, and use the dates in the file timestamp? I guess this can be done by using "find", "sed" and "touch"? Can... (6 Replies)
Discussion started by: qwerty1234
6 Replies

9. Shell Programming and Scripting

Extract date from filename and create a new file

Hi, i have a filename CRED20102009.txt in a server 20102009 is the date of the file ddmmaaaa format the complete route is /dprod/informatica/Fuentes/CRED20102009.csv i want to extract the date to create a new file named Parameters.txt I need to create Parameters.txt with this... (6 Replies)
Discussion started by: angel1001
6 Replies

10. Shell Programming and Scripting

part of a filename

Hi, I need to extract only a part of the filenames of some files. The files are named this way : .tap_profile_SIT02 I want the "SIT02" part, which is not the same for each file. I was able to get what I want with bash, but not with ksh. Here is the command I used in bash : find... (8 Replies)
Discussion started by: flame_eagle
8 Replies
Login or Register to Ask a Question
Locale::Maketext::Extract::Plugin::Base(3pm)		User Contributed Perl Documentation	      Locale::Maketext::Extract::Plugin::Base(3pm)

NAME
Locale::Maketext::Extract::Plugin::Base - Base module for format parser plugins SYNOPSIS
package My::Parser::Plugin; use base qw(Locale::Maketext::Extract::Plugin::Base); sub file_types { return [qw( ext ext2 )] } sub extract { my $self = shift; local $_ = shift; my $line = 1; while (my $found = $self->routine_to_extract_strings) { $self->add_entry($str,[$filename,$line,$vars]) } return; } DESCRIPTION
All format parser plugins in Locale::Maketext::Extract inherit from Locale::Maketext::Extract::Plugin::Base. If you want to write your own custom parser plugin, you will need to inherit from this module, and provide "file_types()" and "extract()" methods, as shown above. METHODS
new() $plugin = My::Parser->new( @file_types # Optionally specify a list of recognised file types ) add_entry() $plugin->add_entry($str,$line,$vars) "entries()" $entries = $plugin->entries; "clear()" $plugin->clear Clears all stored entries. file_types() @default_file_types = $plugin->file_types Returns a list of recognised file types that your module knows how to parse. Each file type can be one of: o A plain string 'pl' => base filename is matched against qr/.pl$/ '*' => all files are accepted o A regex qr/.tt2?./ => base filename is matched against this regex o A codref sub {} => this codref is called as $coderef->($base_filename,$path_to_file) It should return true or false extract() $plugin->extract($filecontents); extract() is the method that will be called to process the contents of the current file. When it finds a string that should be extracted, it should call $self->add_entry($string,$line,$vars]) where $vars refers to any arguments that are being passed to the localise function. For instance: l("You found [quant,_1,file,files]",files_found) string: "You found [quant,_1,file,files]" vars : (files_found) IMPORTANT: a single plugin instance is used for all files, so if you plan on storing state information in the $plugin object, this should be cleared out at the beginning of "extract()" known_file_type() if ($plugin->known_file_type($filename_with_path)) { .... } Determines whether the current file should be handled by this parser, based either on the list of file_types specified when this object was created, or the default file_types specified in the module. SEE ALSO
xgettext.pl for extracting translatable strings from common template systems and perl source files. Locale::Maketext::Lexicon Locale::Maketext::Extract::Plugin::Perl Locale::Maketext::Extract::Plugin::PPI Locale::Maketext::Extract::Plugin::TT2 Locale::Maketext::Extract::Plugin::YAML Locale::Maketext::Extract::Plugin::FormFu Locale::Maketext::Extract::Plugin::Mason Locale::Maketext::Extract::Plugin::TextTemplate Locale::Maketext::Extract::Plugin::Generic AUTHORS
Clinton Gormley [DRTECH] <clinton@traveljury.com> COPYRIGHT
Copyright 2002-2008 by Audrey Tang <cpan@audreyt.org>. This software is released under the MIT license cited below. The "MIT" License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. perl v5.14.2 2011-03-02 Locale::Maketext::Extract::Plugin::Base(3pm)