1

I have a LDIF file with structure that looks similar to:

NUMBER: 44567898787
ORGANISATION: Something
NAME: Joe
SURNAME: Johnny
PLACE: Somewhere

NUMBER: 44555444333
ORGANISATION: Unknown
NAME:Alice
SURNAME: State
PLACE: Here

I'm using AWK atm:

#!/usr/bin/awk -f
BEGIN{
        FS = ":";
}
{
        if($1 ~/^ORGANISATION/ ){ lm = $2 }
    if( lm ~ /UNKNOWN/) if ( $1 ~ /^NAME/ ) 
                print "NAME:" $2 " ORGANISATION: " lm;
}
END{}

In general what I want to achieve is to make it more interactive, so waiting for STDIN to enter the ATTRIBUTE like ORGANISATION, after that its VALUE like Unknown and print it or save to file. Working on file (as I mentioned) that have more than 10 Gigs. Any ideas?

Empe
  • 11
  • 2
  • Stack Overflow is not a code writing service. Please show your code. Since Stack Overflow hides the Close reason from you: *Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/).* – jww Mar 22 '18 at 22:48

0 Answers0