Converts the Columns into Rows

hi ,

I have a requirement where in to read the .xls file which is having data and transpose the columns into rows and create a csv file as a output . Below is the screenshots for the input and output . i tried in pivot its working but the columns will be dynamic . Suppose pid and pname is constant but the data coming in the file varies day to day . Is there anyway that we can achieve this scenario . Input Output