← Back to team overview

sikuli-driver team mailing list archive

[Question #264354]: how to read one complete row in in CSV

 

New question #264354 on Sikuli:
https://answers.launchpad.net/sikuli/+question/264354

Hello,
I'm trying to read a complete row which is containing two three points in my CSV document. but it is reading first line of the row and come back to the script. Please help me to come out from the issue.

My script:
import csv

# Enter file name details
file = input("Enter File name")
if (file == ""):
    popup("No file name given")
    exit(0)
# Enter Row number details  
Row = int(input("Enter a row number"))
if(Row == ""):
    popup("no row number given")
    exit(0)
# main Function call
def lineFromCSV(file, Row):
    data = csv.reader(open(file), delimiter=' ', quotechar='|')
    for i in range(Row+1) :
        Row = data.next()
    return Row

def extractColInfo(temp):
    for i in range(7):
        tt[i] = temp[i]
        popup (str(tt[i]))

        
temp = lineFromCSV(file, Row)
#extractColInfo(temp)

popup( ', '.join(temp))
popup ("Done")

Sl No	DO-229D	STP ID	Scenario	Simulator	Dump
1	2.1.1.2 (b)
        2.1.1.3.1 (b)	STP-GPSBL-007	gpsb028	Spirent	Iono_corrections_from_gps
2	2.1.1.2 (c )
        2.1.1.3.1 (c )	STP-GPSBL-008	gpsb028	Spirent	Iono_corrections_from_waas[sv].validity 
                                                                                                        No_of_svs_for_iono_corrections
3	2.1.1.2 (d)
        2.1.1.3.1 (d)
        2.1.1.2 (g)	STP-GPSBL-009	gpsb028	Spirent	Tropospheric_corrections [var_sv] 



-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.