how to create Excel files from Data extracted from tests

hpatelhpatel Posts: 16

My use case is generate excel file from data extracted from tests like DB Tool or Extension tool. Can someone help?

Tagged:

Comments

  • OmarROmarR Posts: 186 admin
    edited May 2017

    After extracting the data to a csv file, I believe simply changing the extension from .csv to .xls or .xlsx could suffice. You could follow the steps provided in this post and then write a short script to rename/reformat the .csv file to your desired excel format.

  • hpatelhpatel Posts: 16

    Thanks much Omar, but my biggest worry is CSV only carry value separated by Comma where as my excel file do have color coding and certain format which allows in excel not CSV, how to handle that?

  • hpatelhpatel Posts: 16

    Omar if you mean to rename the file like ren "filename.csv" "filename.xls" it's not converting into right format of Excel and showing below message... if you can explain in details would be great.

  • jakubiakjakubiak Posts: 270 ✭✭✭

    If you want to automatically generate an Excel file which has specific formatting, simply converting from CSV to Excel will not support that. You would need to write your own code using some library like Apache POI to generate the Excel file with the behavior that you desire.

  • hpatelhpatel Posts: 16
    edited May 2017

    @jakubiak thanks much for input, could you help if you have done this (generating Excel) through sample code in jython/java/javascript or any other support by SOATest?

  • jakubiakjakubiak Posts: 270 ✭✭✭

    Unfortunately I don't have a specific example I have written that I can show you - but you can take a look here: https://poi.apache.org/spreadsheet/how-to.html

  • hpatelhpatel Posts: 16

    again, thanks much @jakubiak

Sign In or Register to comment.