Sponsored Content
Full Discussion: Finding the Latest record
Top Forums Shell Programming and Scripting Finding the Latest record Post 302898105 by srikanth38 on Friday 18th of April 2014 04:21:08 PM
Old 04-18-2014
Finding the Latest record

Dear All,

I have getting data as follows, the second field signifies table name and last one is time stamp. I have return always latest record based on time stamp. Could you please help me ?

I/P
====

Code:
5460-DataAcqu-MF-Extract|bill_cycle_code|SW25|?|?|?|FEDWM708|SALES|MF-Extract/ftp|?|Refresh|M|1st00:15|acqxmain|sw25_20060901_000521|fedex5|184360|2006-09-0100:10:51
5460-DataAcqu-MF-Extract|bill_cycle_code|SW25|?|?|?|FEDWM708|BILCYCLE|MF-Extract/ftp|?|Refresh|M|1st00:15|acqxmain|SW25_20140401_000520|fedex5|184360|2014-04-0105:32:58
5460-DataAcqu-MF-Extract|cash_only_reason_code|SW21|?|?|?|FEDWM704|SALES|MF-Extract/ftp|?|Refresh|D|1st00:15|acqxmain|sw21_20060901_000559|fedex5|184360|2006-09-0100:11:17
5460-DataAcqu-MF-Extract|cash_only_reason_code|SW21|?|?|?|FEDWM704|CASHONLY|MF-Extract/ftp|?|Refresh|D|1st00:15|acqxmain|sw21_20140401_000549|fedex5|184360|2014-04-0105:33:09
5460-DataAcqu-MF-Extract|ctry_x_lang|CTLG|?|?|?|FEDWM056|FEDW056|MF-Extract/ftp|?|Refresh|M|1stat09:00|acqxmain|CTLG_20140401_090032|fedex5|490350|2014-04-0114:06:13
5460-DataAcqu-MF-Extract|edw_domain|DOMN|?|?|?|FEDWD041|FEDW041|MF-Extract/ftp|?|Refresh|W|Sun9:00|acqxmain|DOMN_fix_20031005|fedex5;fedex7|473901|2006-09-1709:08:36
5460-DataAcqu-MF-Extract|edw_domain|DOMN|?|?|?|FEDWW120|FEDW078|MF-Extract/ftp|?|Refresh|W|Sun9:00|acqxmain|domn_20140415_134516|fedex5;fedex7|473901|2014-04-1519:49:19
5460-DataAcqu-MF-Extract|sic_code|SW23|?|?|?|FEDWM706|FEDW255|MF-Extract/ftp|?|Refresh|M|1st00:15|acqxmain|SW23_20140401_000515|fedex5|184360|2014-04-0105:32:07
5460-DataAcqu-MF-Extract|sic_code|SW23|?|?|?|FEDWM706|SALES|MF-Extract/ftp|?|Refresh|M|1st00:15|acqxmain|SW23_20060901_000521|fedex5|184360|2006-09-0100:10:11

O/P
=====
Code:
5460-DataAcqu-MF-Extract|bill_cycle_code|SW25|?|?|?|FEDWM708|BILCYCLE|MF-Extract/ftp|?|Refresh|M|1st00:15|acqxmain|SW25_20140401_000520|fedex5|184360|2014-04-0105:32:58
5460-DataAcqu-MF-Extract|cash_only_reason_code|SW21|?|?|?|FEDWM704|CASHONLY|MF-Extract/ftp|?|Refresh|D|1st00:15|acqxmain|sw21_20140401_000549|fedex5|184360|2014-04-0105:33:09
5460-DataAcqu-MF-Extract|ctry_x_lang|CTLG|?|?|?|FEDWM056|FEDW056|MF-Extract/ftp|?|Refresh|M|1stat09:00|acqxmain|CTLG_20140401_090032|fedex5|490350|2014-04-0114:06:13
5460-DataAcqu-MF-Extract|edw_domain|DOMN|?|?|?|FEDWW120|FEDW078|MF-Extract/ftp|?|Refresh|W|Sun9:00|acqxmain|domn_20140415_134516|fedex5;fedex7|473901|2014-04-1519:49:19
5460-DataAcqu-MF-Extract|sic_code|SW23|?|?|?|FEDWM706|FEDW255|MF-Extract/ftp|?|Refresh|M|1st00:15|acqxmain|SW23_20140401_000515|fedex5|184360|2014-04-0105:32:07


Last edited by Don Cragun; 04-18-2014 at 05:39 PM.. Reason: Add CODE tags.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

finding latest file in Unix

Hi, i want to search a file in the dir , if file exists for todays date print the message that file found or if file does not exist for todays date/ if file not found i want to display message saying that file not found. How to do this. Thx for your help. (2 Replies)
Discussion started by: nick12
2 Replies

2. Shell Programming and Scripting

finding latest file having timestamp on it.....

Hi guys, I have a directory in UNIX having files with the below format, i need to pickup the latest file having recent timestamp embedded on it, then need to rename it to a standard file name. Below is the file format: filename_yyyymmdd.csv, i need to pick the latest and move it with the... (1 Reply)
Discussion started by: kaushik25
1 Replies

3. Shell Programming and Scripting

Help in writing a KSH script to filter the latest record?

Hi All, I have a text file with the folowing content. BANGALORE|1417|2010-02-04 08:41:04.174|dob|xxx BANGALORE|1416|2010-02-04 08:23:19.566|dob|yyy BANGALORE|1415|2010-02-04 08:20:14.497|dob|aaa BANGALORE|1414|2010-02-04 08:19:40.065|dob|vvv BANGALORE|1413|2010-02-04... (4 Replies)
Discussion started by: Karpak
4 Replies

4. Shell Programming and Scripting

Finding the Latest file in a Dir

Hi Everyone, I am writing a shell script and I am struck here: I need to find the latest file in a directory depending upon the date. For example: The files in the directory are: Filename_bo_20110619 Filename_bo_20110620 Filename_bo_20110621 Filename_bo_20110622 So here, I want... (2 Replies)
Discussion started by: filter
2 Replies

5. UNIX for Dummies Questions & Answers

Finding latest dir based on it's name (yyyymmdd)

Hi Folks, As part of my application I need to find out what the latest directory based on the name of that directory (not it's file system timestamp). Example: I have a directory which contains below directories (each of while contains files etc) 20120000/ 20120000/ latest (symbolic link to... (5 Replies)
Discussion started by: DOWD_R
5 Replies

6. UNIX for Dummies Questions & Answers

[Solved] Finding the latest file in a directory

Hi All, I am using the below command to find the latest file in a dir: ls -tr $v_sftphomedir/$v_sourcefile |tail -1 or ls -t1 $v_sftphomedir/$v_sourcefile |head -1 and the outpur returned is below: /home/cobr_sftp/var/controllingload/Backup/Dbrwds_Div_1796050246.txt I need only the... (5 Replies)
Discussion started by: abhi_123
5 Replies

7. Shell Programming and Scripting

Help with finding the latest modified version of a file within directories

I am trying to look into multiple directories and pluck out the latest version of a specific file, regardless of where it sits within the directory structure. Ex: The file is a .xls file and could have a depth within the directory of anywhere from 1-5 Working directory - Folder1... (6 Replies)
Discussion started by: co21ss
6 Replies

8. Shell Programming and Scripting

Need help with finding the latest files

Hi, Actually i got a client requirment and i need experts help here. we have 30 parent directories and in that we have so many subdirectories and files. i want to find only latest timestamp files with out touching subdirectories and need to redirect the latest files into some other... (3 Replies)
Discussion started by: lkeswar
3 Replies

9. UNIX for Dummies Questions & Answers

Display latest record from file based on multiple columns combination

I have requirement to print latest record from file based on multiple columns combination. EWAPE EW1SLE0000 EW1SOMU01 ABORTED 03/16/2015 100004 03/16/2015 100005 001 EWAPE EW1SLE0000 EW1SOMU01 ABORTED 03/18/2015 140003 03/18/2015 140004 001 EWAPE EW1SLE0000 EW1SOMU01 ABORTED 03/18/2015 220006... (1 Reply)
Discussion started by: tmalik79
1 Replies

10. Shell Programming and Scripting

Finding latest file in dir but getting syntax errors

I believe there are couple of syntax issues in my script, couldn't find them :( can someone help me with fixing it to make it work. cd /abcde/ #get the latest filename excluding subdirs filename=`ls -ltr | grep ^- | tail -1 | awk '{print $8}'` #get system date and file timestamp and... (3 Replies)
Discussion started by: simpltyansh
3 Replies
Locale::Maketext::Extract::Plugin::Generic(3)		User Contributed Perl Documentation	     Locale::Maketext::Extract::Plugin::Generic(3)

NAME
Locale::Maketext::Extract::Plugin::Generic - Generic template parser SYNOPSIS
$plugin = Locale::Maketext::Extract::Plugin::Generic->new( $lexicon # A Locale::Maketext::Extract object @file_types # Optionally specify a list of recognised file types ) $plugin->extract($filename,$filecontents); DESCRIPTION
Extracts strings to localise from generic templates. SHORT PLUGIN NAME
generic VALID FORMATS
Strings inside {{...}} are extracted. KNOWN FILE TYPES
All file types SEE ALSO
xgettext.pl for extracting translatable strings from common template systems and perl source files. Locale::Maketext::Lexicon Locale::Maketext::Extract::Plugin::Base Locale::Maketext::Extract::Plugin::FormFu Locale::Maketext::Extract::Plugin::Perl Locale::Maketext::Extract::Plugin::TT2 Locale::Maketext::Extract::Plugin::YAML Locale::Maketext::Extract::Plugin::Mason Locale::Maketext::Extract::Plugin::TextTemplate AUTHORS
Audrey Tang <cpan@audreyt.org> 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.16.2 2010-08-10 Locale::Maketext::Extract::Plugin::Generic(3)
All times are GMT -4. The time now is 07:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy