Python Forum
Unable to read data from string base64 representing a .xlsx file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to read data from string base64 representing a .xlsx file
#3
(Apr-05-2018, 04:55 PM)Gribouillis Wrote: You most likely need to remove the data:;base64, part in xlStr. You can try
xlStr = xlStr.split(',', 1)[1]
xlDecoded = base64.b64decode(xlStr)

You have made my day sir.... that solved the problem and saved my ass :'):

xlStr = xlStr.split(',', 1)[1]
xlDecoded = base64.b64decode(xlStr)
xlsx = xlrd.open_workbook(file_contents=xlDecoded)
firstSheet = xlsx.sheet_by_index(0)

print(firstSheet.cell(1,0).value)

#It printed and worked perfectly as intended....
Reply


Messages In This Thread
RE: Unable to read data from string base64 representing a .xlsx file - by max - Apr-05-2018, 07:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Connecting to Remote Server to read contents of a file ChaitanyaSharma 1 395 May-03-2024, 07:23 AM
Last Post: Pedroski55
  Help with to check an Input list data with a data read from an external source sacharyya 3 608 Mar-09-2024, 12:33 PM
Last Post: Pedroski55
  Recommended way to read/create PDF file? Winfried 3 3,085 Nov-26-2023, 07:51 AM
Last Post: Pedroski55
  python Read each xlsx file and write it into csv with pipe delimiter mg24 4 1,787 Nov-09-2023, 10:56 AM
Last Post: mg24
  Need to replace a string with a file (HTML file) tester_V 1 880 Aug-30-2023, 03:42 AM
Last Post: Larz60+
  read file txt on my pc to telegram bot api Tupa 0 1,254 Jul-06-2023, 01:52 AM
Last Post: Tupa
  parse/read from file seperated by dots giovanne 5 1,242 Jun-26-2023, 12:26 PM
Last Post: DeaD_EyE
  Formatting a date time string read from a csv file DosAtPython 5 1,595 Jun-19-2023, 02:12 PM
Last Post: DosAtPython
  How do I read and write a binary file in Python? blackears 6 8,009 Jun-06-2023, 06:37 PM
Last Post: rajeshgk
  Read csv file with inconsistent delimiter gracenz 2 1,341 Mar-27-2023, 08:59 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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