Forum Discussion

danielko's avatar
danielko
New Contributor
12 years ago

CSV File - ignore first row?

Hi,

I define a "DataSource: File" with Separator ";". How can I ignore the first row which contains the heading of each column?
I know this is possible with xls, but as our tools only generate csv, I cannot use excel here.

Thanks

4 Replies

  • tjdurden's avatar
    tjdurden
    Frequent Contributor
    Hi danielko,

    As far as I'm aware, you can't add a dataSource in the free SoapUI version. I suggest you ask over on the SoapUI Pro support forums. They should be able to help you.

    Kind regards,
    Tim
  • danielko's avatar
    danielko
    New Contributor
    I can in the trail, and would like to know if this could work?
  • I know this is possible with xls, but as our tools only generate csv, I cannot use excel here.Thanks
  • MartinSpamer's avatar
    MartinSpamer
    Frequent Contributor

    File file = new File( filename )
    def dataFile = file.readLines()
    def fileHeaderLine = dataFile[0]
    def fileBody = dataFile[1..dataFile.size()-1]
    log.info "body="+fileBody
    fileBody.each { ... }