i have a text file (it`s a ldif export), and i would like to grep out the dn. the line with the dn starts with "dn:". no problem so far to grep for this pattern.
but the ldif export makes a line break after 76 characters, and continues the next line with a "space" character.
since i need the full dn, i need a way to:
1) search for this lines which start with a leading "space"
2) remove this "space"
3) and finally join the line which had the space, with the previous line
i have tried several ways with sed, awk, tr, ... but since i´m quite new to this topics i dont get it solved. does anyone here have a hint for me, how to do this task?
thanks in advance,