10-06-2006
extract date portion from file
Hi,
I have a file where there is a date field (single line variable length file)
how to extract just the date portion from it
the position of date field may vary anywhere in the line
but will always have the format mm-dd-yyyy
for eg .
xxxxxxxxxxxxxxx09-10-2006xxxxxxxxxxxxxxxxxxxx
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hello,
I want to grep the log file according to time and get the portion of log from one particular time to other.
I can grep for individual lines by time but how should I print lines continuously from given start time till end till given end time.
Appreciate your ideas,
Thanks
chandra (8 Replies)
Discussion started by: chandra004
8 Replies
2. UNIX for Dummies Questions & Answers
I am using Unix on Mac OS X 10.5.6.
I am trying to extract the last entry of a log (text) file. As seen below, each log entry looks like the following (date and time change with each log entry):
I want the script to extract everything quoted above, including the "===" dividers.
... (2 Replies)
Discussion started by: atilano
2 Replies
3. Shell Programming and Scripting
Hi All
I have 3 files as listed below and highlighted in bold the portions of the filenames I need to extract:
TOS_TABIN218_20090323.200903231830
TOS_TABIN219_1_20090323.200903231830
TOS_TABIN219_2_20090323.200903231830
I tried
source_tabin_name=`echo $fname | sed 's/_.*//'`
but I... (6 Replies)
Discussion started by: santam
6 Replies
4. Shell Programming and Scripting
Hi All,
I posted something similar before but I now have a another problem.
I have filenames as below
TOP_TABIN240_20090323.200903231830
TOP_TABIN235_1_20090323.200903231830
i need to extract the dates as in bold. Using bash v 3.xx
Im trying to using the print sed command but... (11 Replies)
Discussion started by: santam
11 Replies
5. Shell Programming and Scripting
Can some one help me with shell script to extract a text block between two known strings.
The given input file is as below:
Name: abs
Some tesxt....
Some tesxt....
Some tesxt....
end of text
Name: xyz
Some tesxt....
Some tesxt....
Some tesxt....
end of text
Name: efg
Some... (5 Replies)
Discussion started by: ejazs0
5 Replies
6. Shell Programming and Scripting
Hi Gurus,
I'm using HP-UX B.11.23 operating system.
I've been trying to extract a specific wording for example: "A tool used by tp produced warnings" from my below log data, but could not find a way to solve it. My intention is, if the log contain the word: "A tool used by tp produced... (9 Replies)
Discussion started by: superHonda123
9 Replies
7. UNIX for Dummies Questions & Answers
hi,
I am trying to remove the last field before the period (.) from a list of file names in a directory in a shell script.
Below is the list of file names.
ENVID_archival_20120214092258.log
ENVID_Get_Source_Files_20120214091828.log
ENVID_Get_Source_Files_20120214092523.log... (6 Replies)
Discussion started by: Vijay81
6 Replies
8. Shell Programming and Scripting
Hi Gurus,
Would like to seek some help on how to extract a portion of string from log's output as shown below.
Sample of raw data:
piece handle=/test123/disk_dump/test123/df0_cntrl_PCPFCI20120404_68498 tag=TAG20120404T180035 comment=NONE
piece... (13 Replies)
Discussion started by: superHonda123
13 Replies
9. Shell Programming and Scripting
Hi Gurus,
I need some help in extracting some of these information and massage it into the desired output as shown below.
I need to extract the last row with the header in below sample which is usually the most recent date, for example:
2012-06-01 142356 mb 519 -219406 mb 1 ... (9 Replies)
Discussion started by: superHonda123
9 Replies
10. UNIX for Beginners Questions & Answers
Hi I have to extract the destination path information from each record the file is of variable length so I will not be able to use the print command.The search should start on variable "destinationPath" and it should end at immediate "," also the first field has to be printed
Input File:... (7 Replies)
Discussion started by: rkakitapalli
7 Replies
LEARN ABOUT DEBIAN
debian::l10n::utils
Debian::L10n::Utils(3pm) User Contributed Perl Documentation Debian::L10n::Utils(3pm)
NAME
Debian::L10n::Utils - Utilities for the dl10n tools
parse_subject(SUBJECT)
parse_subject extract valuable informations from a subject line.
It gets a string containing the subject line (SUBJECT).
It returns an array containing the status, type, filename strings and bug number if provided or 'undef' if no status is found.
parse_from(FROM)
parse_from extract the sender name from the 'From:' field.
The name is build from the phrase part of the field, or if none is found, from the comment part where parentheses are removed, or if none
is found, from the address where all non-alphanumeric characters are turned into spaces.
It gets a string containing the 'From:' field (FROM).
It returns a string containing the name.
parse_date(DATE)
parse_date extract the date from a 'Date:' field.
It gets a string containing the 'Date:' field (DATE).
It returns a string containing the date in ISO format yyyy-mm-dd hh:mm:ss AXhh:mm based on GMT
LICENSE
This program 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; if not, write to the Free Software Foundation, Inc., 59 Temple Place -
Suite 330, Boston, MA 02111-1307, USA.
COPYRIGHT (C)
2003,2004 Tim Dijkstra
2004 Nicolas Bertolissio
2004 Martin Quinson
2008 Nicolas FranA~Xois
perl v5.14.2 2012-01-15 Debian::L10n::Utils(3pm)