Hi Rob, I have a big file containing about 200000 lines. This file basically contains some records. A sample of the file is as given below: dn: cn=1148734,ou=Employees,dc=jci,dc=com
displayname: Herek, Moriah L jdirlastfourssn: 2888 dn: cn=1148735,ou=Employees,dc=jci,dc=com displayname: Pelletier, Michael J jdirlastfourssn: 8719 uid: cpellem dn: cn=1148736,ou=Employees,dc=jci,dc=com displayname: Manimanakis, Aris N jdirlastfourssn: 0366 dn: cn=1148738,ou=Employees,dc=jci,dc=com displayname: Bernardini, James A jdirlastfourssn: 8540 dn: cn=1148739,ou=Employees,dc=jci,dc=com displayname: Steyvers, Robert L jdirlastfourssn: 8634 dn: cn=1148740,ou=Employees,dc=jci,dc=com displayname: Vest, Elizabeth G jdirlastfourssn: 7487 What I need to do is: 1. Take the first entry and get the value of the display name and jdirlastfourssn attribute. 2. Check whether there is another record with the same display name attribute value.(There cud be multiple records) 3. If so then extract both record and write them into another file. 4. Delete these duplicate records from the parent file. 5. Do that for all records. Please see if you can help me in doing this. Regards, Mohit -----Original Message----- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Sat 6/14/2003 3:39 AM To: [EMAIL PROTECTED] Cc: Subject: Re: Help required.....about string/text manipulation Mohit_jain01 wrote: > Hi, > > I am facing a problem with text file manipulation with Perl. > > I have a file with over 2 lac lines of data. > I need to find the duplicates(strings) in the file and copy those records into another file. > > Is there a function/module in Perl by which I can read the duplicates in a file at one go and print them > on to another file. Hi. Before we can help you we need to know a little more of your problem. Are you looking for duplicate lines in the file, or duplicate strings defined in some other way? How big is the file you want to read (how many lines or strings do you want to compare)? There are modules which will help you write your program, but exactly how you go about it depends on the details of your problem. Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]