Hi,
I'm needing a little help getting a text/tab delimited file imported in with python. I think I'm missing how to import the columns... This is what my text file looks like. I was thinking it was a tab delimited file but when I import it in from out Gerber cutters it comes in as a text file. So maybe I'm wrong somewhere there...
I run the code below to try and convert it to .csv so I can convert it to .xlsx
I'm thinking it's because of this part of the code with the ;
Thanks,
Veronica
I'm needing a little help getting a text/tab delimited file imported in with python. I think I'm missing how to import the columns... This is what my text file looks like. I was thinking it was a tab delimited file but when I import it in from out Gerber cutters it comes in as a text file. So maybe I'm wrong somewhere there...
I run the code below to try and convert it to .csv so I can convert it to .xlsx
import pandas as pd save_path = "C:/Users/vhubb/Documents/Python Scripts" in_filename = os.path.join(save_path,'mytxt.txt') out_filename = os.path.join(save_path,'Output.csv') df = pd.read_csv(in_filename, sep=";") df.to_csv(out_filename, index=False)But when I run this code it converts all columns into one
I'm thinking it's because of this part of the code with the ;
df = pd.read_csv(in_filename, sep=";")Or am I going completely wrong with what I'm thinking. I'm trying to import this text file with specific columns into a .xlsx file that I created with python. The same .xlsx file (Cutter A - Marker Report.xlsx) that I mentioned in an earlier post. I was thinking I needed to convert it to a .csv file that I would then need to convert to a .xlsx file. From there I was going to figure out how to import it in to the correct columns for the Cutter A - Marker Report.xlsx that I have created.
Thanks,
Veronica