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
PCAP_SET_TSTAMP_TYPE(3PCAP)											       PCAP_SET_TSTAMP_TYPE(3PCAP)

NAME
pcap_set_tstamp_type - set the time stamp type to be used by a capture device SYNOPSIS
#include <pcap/pcap.h> int pcap_set_tstamp_type(pcap_t *p, int tstamp_type); DESCRIPTION
pcap_set_tstamp_type() sets the the type of time stamp desired for packets captured on the pcap descriptor to the type specified by tstamp_type. It must be called on a pcap descriptor created by pcap_create() that has not yet been activated by pcap_activate(). pcap_list_tstamp_types() will give a list of the time stamp types supported by a given capture device. See pcap-tstamp(7) for a list of all the time stamp types. RETURN VALUE
pcap_set_tstamp_type() returns 0 on success if the specified time stamp type is expected to be supported by the capture device, PCAP_WARN- ING_TSTAMP_TYPE_NOTSUP on success if the specified time stamp type is not supported by the capture device, PCAP_ERROR_ACTIVATED if called on a capture handle that has been activated, and PCAP_ERROR_CANTSET_TSTAMP_TYPE if the capture device doesn't support setting the time stamp type. SEE ALSO
pcap(3PCAP), pcap_list_tstamp_types(3PCAP), pcap_tstamp_type_name_to_val(3PCAP), pcap-tstamp(7) 21 August 2010 PCAP_SET_TSTAMP_TYPE(3PCAP)
All times are GMT -4. The time now is 02:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy