Forum Discussion

haridi's avatar
haridi
Occasional Contributor
9 years ago
Solved

redaing values from csv file when the value is alpha numeric it produce null value

I'm trying to read values from csv file the column has different values when it gets to alpha numeric it reads null.

 

content of csv file:

Tracer
9150080274
81517690080130
9150080530
81517690080198
9150080512
81517690080211
9150080761
81517690080400
50083AB6691SYS
50083AB6781SYS

 

output with Log.Message:

Type Message Time Priority Has Picture Link
9150080274 15:48:55 Normal
81517690080130 15:48:55 Normal
9150080530 15:48:55 Normal
81517690080198 15:48:55 Normal
9150080512 15:48:55 Normal
81517690080211 15:48:56 Normal
9150080761 15:48:56 Normal
81517690080400 15:48:56 Normal
15:48:56 Normal
15:48:56 Normal
The menu item 'File|Exit' was clicked. 15:48:56 Normal

 

3 Replies

  • Ravik's avatar
    Ravik
    Super Contributor

    Wow it's strange,

     

    TestComplete return 'Null' value while it's reading alphanumeric data from csv.

     

    Do one thing add data as a "String" in csv file. when data is in "String" format it will retun all the values correctly.

     

    Function terer

    Call DDT.CSVDriver("C:\Users\a55610\Desktop\test12.csv")

    While Not DDT.CurrentDriver.EOF

     

    log.Message(DDT.CurrentDriver.Value(0))

    log.Message(aqConvert.VarToStr(DDT.CurrentDriver.Value(0)))

     

    DDT.CurrentDriver.Next

    Wend

     

    DDT.CloseDriver(DDT.CurrentDriver.Name)

     

    End Function

     

     

    "81517690080211"
    "9150080761"
    "81517690080400"
    "50083AB6691SYS"
    "50083AB6781SYS"

     

     

    If this data is auto generated the before adding into cvs convert it into string .

     

    This may help you. :)