Complex sentence: She was commissioned on 31 October 1940, with "Kapitänleutnant" Eitel-Friedrich Kentrat in command until March 1942, when he was succeeded by "Oberleutnant zur See" Karl Friederich, who remained in command until the U-boat's loss.
Split into simpler sentences: She was commissioned 31 October 1940, with "Kapitänleutnant" Eitel-Friedrich Kentrat in command. Kentrat commanded her until March 1942, when he was relieved by "Oberleutnant zur See" Karl Friederich, who remained in command until the U-boat's loss.