We have a plain-text data file named stuff.txt in which each…
We have a plain-text data file named stuff.txt in which each line contains a 9-digit long social security number, followed by a single space, a first name of variable length but containing no spaces, another single space, a similarly structured last name, yet another single space, and finally a variable-length single word representing a password. Provide a way to generate a file stuff-revised.txt in which the last name and first name have been swapped positions. For instance, the following line from the original file: 555993333 Malfurion Stormrage azeroth Would be transformed to: 555993333 Stormrage Malfurion azeroth