shell - find the second word in first line which starts with specific word and replace the next line first word in linux -


I need to convert the following files to a new file ...

I have a file with me ....

  uid = GESCHELP1, or = special user, DC = domain, DC = com different: C1: Ind variations: SO1: REC UID = GESEXHP2, oo = special User, DC = Domain, DC = Com Separate: Country 1: United States Separate: given name 1: Raj   

should follow the output file ....... < / P> DA : UID = GSEXHAP1, OU = Special User, DC = Domain, DC = COM Change Type: Change Change: CC: ING - CC: SOP SR: REC UID = GESEXHAP2, OA = Special User, DC

Please help me get the solution. P>

This command will give the necessary results

awk -F ': *' -v OFS = ":" '$ 1 == "Replace" {r = $ 2; Print; Next} r {$ 1 = R; R = ""} 7 'file

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -