LDIF Data sorting by timestamp


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting LDIF Data sorting by timestamp
# 1  
Old 01-07-2015
Hammer & Screwdriver LDIF Data sorting by timestamp

I am a newbie and need awk or sed script to run against LDIF format data and sort by create time stamp
# 2  
Old 01-07-2015
Welcome atlowi,

I have a few to questions pose in response first:-
  • Is this homework/assignment? There are specific forums for these.
  • What have you tried so far?
  • What input data do you have? (sanitised if you need to)
  • What output do you need from the given input?
  • What output/errors do you get?
  • What OS and version are you using?
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.


We're all here to learn and getting the relevant information will help us all.
# 3  
Old 01-07-2015
Quote:
What input data do you have? (sanitised if you need to) -
Code:
dn: uid=8064203001,cn=subscribers,ou=people,ou=users,dc=metropcs,dc=net
objectclass: oblixPersonPwdPolicy
objectclass: top
objectclass: person
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: mpcsOrgPerson
objectclass: oblixorgperson
cn: 41243352140
sn: Orire
givenname: Lakasa
mail: omimio@gmail.com
uid: 4049191234
accountid: 560302480
acctstatus: ACTIVE
mdn: 3071301000
oldsalt: 8165302000
pinholder: N
role: Subscriber
secans1: 0b29162234055468c41a4de9eb6c754d
secq1: Q14
tcacceptance: Y
tcpackageid: 101.0
ssoacctstatus: ACTIVE
modifytimestamp: 20140725143308z
createtimestamp: 20140723151107z

Quote:
What output do you need from the given input? -
need to take out last 48 hours of data which is not unique on one of the attribute (mdn)

Quote:
What output/errors do you get?
None

Quote:
What OS and version are you using?
RHEL 6.0

Quote:
What are your preferred tools? (C, shell, perl, awk, etc.) -
awk/sed
Quote:
What logical process have you considered? (to help steer us to follow what you are trying to achieve)
none

Many thanks for your help

Last edited by Don Cragun; 01-07-2015 at 03:25 PM.. Reason: Clarify questions and responses; add CODE and QUOTE tags.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sorting files based on timestamp and picking the latest file

Hi Friends, Newbie to shell scripting Currently i have used the below to sort data based on filenames and datestamp $ printf '%s\n' *.dat* | sort -t. -k3,4 filename_1.dat.20120430.Z filename_2.dat.20120430.Z filename_3.dat.20120430.Z filename_1.dat.20120501.Z filename_2.dat.20120501.Z... (12 Replies)
Discussion started by: robertbrown624
12 Replies

2. Shell Programming and Scripting

Urgent ...pls Sorting files based on timestamp and picking the latest file

Hi Friends, Newbie to shell scripting. Currently i have used the below to sort data based on filenames and datestamp $ printf '%s\n' *.dat* | sort -t. -k3,4 filename_1.dat.20120430.Z filename_2.dat.20120430.Z filename_3.dat.20120430.Z filename_1.dat.20120501.Z filename_2.dat.20120501.Z... (1 Reply)
Discussion started by: robertbrown624
1 Replies

3. Shell Programming and Scripting

fetch data between two timestamp using script

Hi Guys, I have the data in below format. 25 Dec 2011 03:00:01 : aaaaaaaaaaaaaaa 25 Dec 2011 04:23:23 : bbbbbbbbbbbbbbb 25 Dec 2011 16:12:45 : ccccccccccccccc 26 Dec 2011 04:45:34 : ddddddddddddddd 26 Dec 2011 17:01:22 : eeeeeeeeeeeeeee 27 Dec 2011 12:33:45 : ffffffffffffffffffffffff 28... (13 Replies)
Discussion started by: jaituteja
13 Replies

4. Shell Programming and Scripting

Sorting the Data

My actual data looks like below i have given only format. i can't give exact data format of my requirement due to some reasons. I this set of data lines about 5000 I need to come up with information in below exact format of my data set : Line<space>Number1<space>"somedata":... (1 Reply)
Discussion started by: ckaramsetty
1 Replies

5. UNIX for Dummies Questions & Answers

Help with Data Sorting

Hi All, I have a long list made of 4 columns containing entries such as the following example: a b c d 0 0 0 0 1 2 1 2 2 5 3 4 3 8 4 6 4 10 9 8 5 15 8 10So the top row is the header and I need to arrange the data in a way as to... (11 Replies)
Discussion started by: pawannoel
11 Replies

6. UNIX for Dummies Questions & Answers

Format/Fix Timestamp Data in a File.

Hello Experts, I have a timestamp(6) column in a .csv data file , format of the data is as below:- ETCT,P,Elec, Inc.,abc,11/5/2010 4:16:09.000000 PM,Y,Y,Y I want the timestamp column to be properly formatted like 11/05/2010 04:16:09.000000 PM Currently the "0" is missing with... (3 Replies)
Discussion started by: mtlrsk
3 Replies

7. UNIX for Dummies Questions & Answers

Sorting data

Hello guys. I need help figuring this one out. It's probably really easy. Thanks in advance! I have a file say for example containing this: Rice Food Carrots Food Beans Food Plates Kitchen Fork Kitchen Knives Kitchen I need: Food Rice, Carrots, Beans Kitchen Plates, Fork,... (7 Replies)
Discussion started by: visuelz
7 Replies

8. UNIX for Dummies Questions & Answers

Sorting data from a to z

Hi, Let's say I have these 3 columns; NGC1234 6 9 SL899 4 1 NGC1075 8 3 SL709 5 2 And I want to sort the data according to the first column (from a to z) like having them as: NGC1075 8 3 NGC1234 6 9 SL709 5 2 SL899 4 1 Can that be done... (2 Replies)
Discussion started by: cosmologist
2 Replies

9. Shell Programming and Scripting

sorting of files on the basis of timestamp

Hi, With the help of below script im able to get the count of all the .xml files but that count is not specific to a day ie its the total count of all .xml files what i want is specific to 1 day and that of every half an hr ie from 23 feb 2009 7 am till 23rd feb 2009 2300 am and from 07:00 to... (1 Reply)
Discussion started by: ss_ss
1 Replies

10. UNIX for Dummies Questions & Answers

sorting data from who by IP

Hello. I have an RS/6000 running AIX 4 and I need to be able to see if there are any users that are logged on more than once from the same terminal so I can kick them off to make room for other terminals. 64 connections is the limit. Currently I am doing this: who | more and then manually... (11 Replies)
Discussion started by: raidzero
11 Replies
Login or Register to Ask a Question