I am new to programming so I apologize for any mistakes. I am trying to make a program where you import a .txt file that is then split by before and after delimiter and put into two columns to then export into an excel file.
I have a list of questions and answers formatted as: "What are the two types of IP addresses?=IPv4 and IPv6." where the delimiter is "=". I want the first column (questions) to be before the = and second column (answers) to be after =.
I've got them separated but I don't know how to get it into columns. Any help would be appreciated.
import pandas as pd
with open(r'C:\Users\Stephanie\OneDrive\Documents\guide3.txt') as guide:
for x in guide.read().split("="):
print(x)
guide.close
The code prints out this. End goal is to have an excel file that looks like this excel file. Any advice or information would be much appreciated. Thank you!