in reply to File Iteration and looking for specific matching data

That looks like an extract from an ldap database. Have you considered instead using Net::LDAP to query the directory directly rather than parsing a dump 'by hand'?

LDAP queries support searching on loose text matches. (E.g. search key on 'maillocaladdress=test1*')

Failing that though, this looks like a fairly straightforward 'while' loop on a filehandle. If you're really insistent on hand-parsing an LDAP directory, you'll probably find the 'range' operator useful to read up on.

  • Comment on Re: File Iteration and looking for specific matching data

Replies are listed 'Best First'.
Re^2: File Iteration and looking for specific matching data
by bshah (Novice) on Mar 24, 2014 at 21:56 UTC

    Hi,

    Thanks for your reply. Yes, this is a database but its a backup file since this data is removed from current database so we need to use file instead of Net::LDAP