I am a very novice coder who needs help combining and rearranging a lot of .txt data. The file is currently listed as follows:
A
lcorn, MS
Aleutians East, AK
Aleutians West, AK
Alexander, IL
Alexander, NC
Alexandria, VA
Alfalfa, OK
Alger, MI
Allamakee, IA
Allegan, MI
Allegany, MD
Allegany, NY
Alleghany, NC
Alleghany, VA
Allegheny, PA
Allen, IN
Allen, KS
Allen, KY
Allen, LA
Allen, OH
Allendale, SC
Alpena, MI
Alpine, CA
Amador, CA
Amelia, VA
Amherst, VA
Amite, MS
I need to rearrange the data so it reads like
MS: Alcorn
AK: Aleutians East
AK: Aleutians West
Essentially in the format of (State): County. I then need to output the newly completed results into a new text file, there are hundreds of lines in the file and I am unaware of where to even start.