I need to read my file, grab the first part of a string (up to the first number), make a new file with that as the name. Then put all the other lines matching that String into the matching file. Example:
ABC1
ABC2
ABC3
CBA1
CBA2
CBA3
So it should read the lines, get the “ABC” from line one, make a file name “ABC” and then put all the ABC rows in the new file. then grab “CBA” make a new file and put all the CBA rows in the CBA File.
Please help!! I am so lost and confused.
I am learning python and have no idea how to start.
Scott Johnson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.