Reputation: 1033
I have an input folder, which consists of few files with .wsr and .wsw format. i need to fetch the file name and few values inside the file name and load it into excel file.
i have attached my sample input file, from that file , i need to take filename, Key, Title, Category
and my output inside excel has to be like.
.
i need to use for each loop cnatiner to fetch this files.
Upvotes: 0
Views: 216
Reputation: 746
To use the for each loop container, see the answer to this: Foreach Loop Container failed to traverse through all files in a folder
The link above, however, creates a solution where you parse a csv file. In this case you will need to do your custom parsing by code. I would use a script task to extract that info from the file.
In this link you have examples on how to use a script task: http://www.programmersedge.com/?p=1350
In the custom script you will be creating you need to open the file with a streamReader and extract the relevant information. The following link has a nice tutorial on how to use the streamreader in C#: http://www.dotnetperls.com/streamreader
Upvotes: 1