Python Forum
Converting excel file to txt file
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Converting excel file to txt file
#1
Hello all,
I am a new user. I would like to convert an excel file to txt file by also doing some modifications in it. Can anyone please tell me how I can convert the file? Thank you.

Muhsin
Reply
#2
Hello

Since you did not tell what modification you want to make in the file I have no clue what code to write. This will help you to kick start

import pandas as pd
xlsx = pd.read_excel('D:\\Users\\path\\blah_blah.xlsx', sheetname=0, index=0)
'''make necessary changes in the dataframe'''
with open('D:\\Users\\path\\blah_blah.txt','w') as outfile:
    pd.to_string(outfile)
Reply
#3
Hello;
I am a new user. How can I read an excel file and convert it to txt file after I processed with it?
Reply
#4
Threads merged.  There's no reason to double post, those of us that help, check pretty much the entire forum.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Data Sorting and filtering(From an Excel File) PY_ALM 0 1,012 Jan-09-2023, 08:14 PM
Last Post: PY_ALM
  Split excel file and write output at specific row and set sheet position DSCA 0 1,960 May-12-2022, 07:29 PM
Last Post: DSCA
  Export dataframe to xlsx - Error "zipfile.BadZipFile: File is not a zip file" Baggio 10 61,419 Mar-12-2021, 01:02 PM
Last Post: buran
  Python - Merge existing cells of Excel file created with xlsxwriter manonB 0 3,687 Mar-10-2021, 02:17 PM
Last Post: manonB
  Creating more than one excel File at once malvarez1976 0 1,792 Dec-15-2020, 02:04 AM
Last Post: malvarez1976
  XLSX file with multiple sheets to josn file ovidius 2 2,193 Apr-05-2020, 09:22 AM
Last Post: ovidius
  Help batch converting .json chosen file to MySQL BrandonKastning 2 2,287 Mar-14-2020, 09:19 PM
Last Post: BrandonKastning
  Convert Excel to .txt - Need each excel row to be separate .txt file cowboykevin05 2 4,735 Jan-03-2020, 06:29 PM
Last Post: Larz60+
  [split] Converting excel file to txt file unexceptionalhobby 2 4,312 Oct-16-2019, 06:34 PM
Last Post: unexceptionalhobby
  Python write result of VAR to excel file wissam1974 8 8,524 Jul-13-2019, 01:09 PM
Last Post: wissam1974

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020