Message: Error reading CSV file (Bad data record: Found a quote within a NonEscapedField)

book

Article ID: 7048

calendar_today

Updated On:

Products

CA Application Test Service Virtualization CA Continuous Application Insight (PathFinder) CA Service Virtualization (DevTest / LISA / VSE / Application Test)

Issue/Introduction

I am reading rows from a delimited data set and getting this error: 

============================================================================ 

| Exception: 

============================================================================ 

| Message: Error reading CSV file 

---------------------------------------------------------------------------- 

| Trapped Exception: Bad data record: Found a quote within a NonEscapedField on line 2 before <soapenv:Envelope xmlns:soapenv= 

| Trapped Message: java.io.IOException: Bad data record: Found a quote within a NonEscapedField on line 2 before <soapenv:Envelope xmlns:soapenv= ---------------------------------------------------------------------------- 

STACK TRACE java.io.IOException: Bad data record: Found a quote within a NonEscapedField on line 2 before <soapenv:Envelope xmlns:soapenv= at com.itko.util.csv.CSVReader.getNextToken(CSVReader.java:335) 

 

The input file has a header row with two columns. 

 

First column is a input number, the second is a SOAP request. 

 

Not sure why I am getting the error.

Cause

CSV file had invalid format for the columns.

Environment

All supported DevTest releases and platforms

Resolution

The problem is in the dataset itself. 

 

Bring up your dataset (comes up in Excel) and do the following format change on each column: 

1. Highlight Column. 

2. Right-Click and choose Format Cells. 

3. Change from General to Text. 

4. Save file. 

 

Was then able to run the test case with no errors.