Service Virtualization

 View Only
  • 1.  Scripted Dataset for text file

    Posted Apr 09, 2018 02:39 AM

    Hi Mike_Gavaghan,


    In continuation to the question asked for Scripted DataSet to read a file which only contains the details for .csv file, Can you please assist with the scripted dataset for .txt file,


    Where the first line contains the actual data followed by multiple lines down the line.


    And how to fetch each row and row length after trimming spaces at the end of the data in each line or record.


    Any kind of suggestion or approach is highly appreciated.


    Thanks in advance!!!



    Bibhudutta Dash


    Input   173 B 1 version

  • 2.  Re: Scripted Dataset for text file

    Posted Apr 10, 2018 02:21 AM

    Hi Tom_A,

    Can you please assist me with the scripted dataset for .txt file.

    As the same concern was raised by you for .csv file, i thought to ask the same.



  • 3.  Re: Scripted Dataset for text file

    Posted Apr 10, 2018 11:29 AM

    Greetings Bibhu –


    The last update was what Mike Gavagan posted.  By the time he responded I had implemented a work around using java.

    I haven’t had an opportunity to try Mikes solution, but I have it booked marked to revisit.  At face value, I like it better than what I did as a hack.


    I just need the time to revisit and test.  I wish I had more to offer, but not at this point.


    Tom Amann

    Advisory Engineer

    Software Engineering

    Ecommerce, Shipping and Tracking Solutions


    T +1 203 796 3190

    M +1 203 376 9282


    Pitney Bowes

    37 Executive Dr.

    Danbury, CT 06810


    Mail Stop: 1B86

    Office: 2D360.9

  • 4.  Re: Scripted Dataset for text file
    Best Answer

    Broadcom Employee
    Posted Apr 10, 2018 12:54 PM

    Hi Bibhu,


    The solution I shared with Tom in that post sounds nearly identical to your needs.  For another example of how to write a scripted dataset, plus look at "scriptedDataSet.tst" in the examples project.


    Also, there is more information here:


    The document is a bit old (version 8.0), but most of the information is still accurate.