While extracting data from excel sheet using python (xlrd package). getting some junk data too -


I am extracting data from excel sheet using the python (xlrd package). With the original data getting some junk data, please help remove those people

going down as junk value such as [text: u:

[text: u 'NAME', text: u'jack ']

  & lt; Code & gt; Xlrd import open_workbook from book = open_workbook ('C: /Users/arun/Desktop/EX.xls') sheet0 = book.sheet_by_index (0) # sheet1 = book.sheet_by_index (1) print sheet0.col (0) print sheet 0 ( 2) Print Sheet 0 Col (3) Print Sheet 0 Col (4) Print Sheet 0 Col (5) Print Sheet 0 COOL (6) Print Sheet 0 COOL (7) Print Sheet 0 Col (8) Print Sheet 0 Col (9) Printing Sheet0.col (10) printing sheet0.col (12) print sheet0.col (13) print sheet0.col (14) print sheet0.col (15) print sheet0.col (16) print sheet0.col (17) print sheet 0 Col (18) Print Sheet 0 Col (19) Print Sheet 0 Col (20) W Rint sheet 0 COL (21) Print sheet Sikpikokok (22) Print Sheet 0 Col (23) Print Sheet 0 Col (24) Print sheet0.col (25) Print sheet0.col (26) Print sheet0.col (27) & lt; / CODE & gt;    

Your "junk" looks like the list of xlrd cell That kind of "text" is that, I do not think it is junk; This is a normal return value created by xlrd if you want a value from the column (say, column 0), then try

  print sheet0.col_values ​​(0)   

see

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

jsp - Google line chart x-axis shrinks on transition -

java - Reaching JTextField in a DocumentListener -