Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

read excel by row and output to txt

import xlrd
import os.path

wb = xlrd.open_workbook(os.path.join('D:TRB 2014 Data','SPS1 demo data.xlsx'))
wb.sheet_names()
sh = wb.sheet_by_index(0)
i = 1
with open("Output.txt", "a") as my_file:
    while sh.cell(i,11).value != 0:
        Load = sh.cell(i,11).value
        all_d = sh.col_values(i, 13, 19)
        DB1 = Load + " " + (" ".join(all_d))
        my_file.write(DB1 + '
')
        i += 1
Comment

PREVIOUS NEXT
Code Example
Python :: dataframe rolling first eleemnt 
Python :: add last item of array at the first index of the array python 
Python :: one function in numpy array 
Python :: how to display python output on html page django 
Python :: figure in matplotlib 
Python :: standard streams with python3 
Python :: numpy replace all values with another 
Python :: how to install dependencies python 
Python :: histogram relative frequency 
Python :: format exponentials python 
Python :: last element of python list 
Python :: python divide all values in list 
Python :: lru cache 
Python :: update matplotlib params 
Python :: how to create a spark schema using a string 
Python :: sum() python 
Python :: python += dictionary 
Python :: make django admin page text box smaller 
Python :: django models filter 
Python :: display column names as a dictionary pandas 
Python :: wordcount pyspark 
Python :: python remove specific character from string 
Python :: stackoverflow python 
Python :: a softmax function 
Python :: custom dataset pytorch 
Python :: python greater than dunder 
Python :: .corr() python 
Python :: Python NumPy asfarray Function Example Tuple to float type array 
Python :: python filter list with list of booleans 
Python :: python math 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =