My.txt file looks like this
This is my code
import pandas as pd
df = pd.read_csv("Chilled Water Data/Sec_CW_BTUs.txt")
df.to_csv("Chilled Water Data/NEWSec_CW_BTUs.csv"
df.to_csv("Chilled Water Data/NEWSec_CW_BTUs.csv")
I am unsure how I can seperate/create colums when converting (also this file is to large to convert in excel).
Funny, but you need to look at something that my nickname suggests, but widely referred to as sep . Specifically, set a separator to what you believe separates the columns.
df = pd.read_csv("Chilled Water Data/Sec_CW_BTUs.txt", sep=" ")
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.