Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transpose CSV File using SSIS

Status
Not open for further replies.
Mar 12, 2003
678
US
I want to transpose the following data that is in a csv file where I create 2 columns; 1 being the Visits row, and the other being the Visitors row. Any ideas?

Code:
Visits	687
Average per Day	687
Average Visit Duration	0:22:22
Median Visit Duration	0:03:37
International Visits	0
Visits of Unknown Origin	1
Visits from Your Country: United States (US)	0
	
	
Visitors	558
Visitors Who Visited Once	477
Visitors Who Visited More Than Once	81
Average Visits per Visitor	1.23
 
Can you give an example of what you want the output to look like?
 
So you don't want any of the others lines like Average Per Day or Visitors Who Visited Once in the output? And are there multiple sets of these in the CSV, or is what you posted in the first post the entire file?
 
The best solution which comes to mind is to use a Script Task in SSIS, which allows you to write VB.Net code. You can loop through the file and assign a string variable to the lines in your file, parsing them for their values in memory and writing the values to a different file should the string comparison meet your criteria.
 
Thanks for the reply, actually I ended up just using a case statement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top