Working with a powershell script for data parameterization

Experiences, small talk, and other automation gossip.
stevelink
Posts: 10
Joined: Thu Jan 10, 2008 6:15 am
Location: Texas
Contact:

Working with a powershell script for data parameterization

Post by stevelink » Tue Dec 23, 2014 5:09 pm

Greetings! We are using Ranorex Studio 5.2 with excel to data-drive our applications. However, we now need to "convert" a powershell "text" file with data in a "sequential record by row" format (-FirstName Danny -LastName Smith -Address 3882 W Congress St -City Mobile -State AL) into data columns, for our excel spreadsheet module variable binding. Is there an easy (quick) way to format a PowerShell script text file into "excel-friendly" columns automatically? (Otherwise, we're doing this "manually", which is quite time-intensive.) Thank you, and Happy Holidays!
Steve

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Working with a powershell script for data parameterization

Post by krstcs » Wed Dec 24, 2014 3:36 pm

You could create another powershell script that reads the first one and puts it in comma-separated-value format, which excel will read.

You would need to loop through the current file's lines and setup the CSV table with headers for the columns.
Shortcuts usually aren't...

stevelink
Posts: 10
Joined: Thu Jan 10, 2008 6:15 am
Location: Texas
Contact:

Re: Working with a powershell script for data parameterization

Post by stevelink » Wed Dec 24, 2014 7:51 pm

krstcs,
Thank you for your reply. I appreciate your thoughts on creating a new powershell script, but as I don't have powershell installed, nor am I am developer, I found a fairly quick method of "manually" copy/pasting the test data into my existing excel data connector, which seems to work for our purposes.
Regards,
Stevelink