I have a text file like this:
ge-0/0/45.0,First-Floor-Security,13 ,Voice_First_Floor,18 ge-0/0/46.0,First-Floor-Security,13 ,Voice_First_Floor,18 ge-0/0/47.0,AV-Media,155 ,Building-Automation,75 ,CobraNet,156 ,First-Floor-Management,19 ,First-Floor-Pavilion,11 ,First-Floor-Security,13 ,First-Floor-Users,10 ,Guest-Wired,3 ,Video,150 ,Voice_First_Floor,18 ,Wireless-Corp,410 ,Wireless-Guest,420 ,Wireless-Mtg,400 ,Wireless-Voice,430 ge-1/0/0.0,First-Floor-Users,10 ,Voice_First_Floor,18
I looking for a command to grab the first field of the line above and insert it into the line below. So for example, my resulting file would look like this:
ge-0/0/45.0,First-Floor-Security,13 ge-0/0/45.0,Voice_First_Floor,18 ge-0/0/46.0,First-Floor-Security,13 ge-0/0/46.0,Voice_First_Floor,18 ge-0/0/47.0,AV-Media,155 ge-0/0/47.0,Building-Automation,75 ge-0/0/47.0,CobraNet,156 ge-0/0/47.0,First-Floor-Management,19 ge-0/0/47.0,First-Floor-Pavilion,11 ge-0/0/47.0,First-Floor-Security,13 ge-0/0/47.0,First-Floor-Users,10 ge-0/0/47.0,Guest-Wired,3 ge-0/0/47.0,Video,150 ge-0/0/47.0,Voice_First_Floor,18 ge-0/0/47.0,Wireless-Corp,410 ge-0/0/47.0,Wireless-Guest,420 ge-0/0/47.0,Wireless-Mtg,400 ge-0/0/47.0,Wireless-Voice,430 ge-1/0/0.0,First-Floor-Users,10 ge-1/0/0.0,Voice_First_Floor,18
I have some understanding about grouping and backreferences but cannot seem to find a way to search, create a backreference, and then use that backreference in a different line. Is this possible? If so, would you please point me in the right direction?