Solved

Parse file to individual records

Posted on 2014-10-30
3
84 Views
Last Modified: 2016-02-13
I have a file that is full of records that always start with VMPIC.

I need to parse out this file and put each of these VMPIC records into a file as individual records.

So I need to look for VMPIC and all data after and write that to a file, then keep doing until all records are in the other file.

SQL 2008
VMPIC.PNG
0
Comment
Question by:thayduck
  • 2
3 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
Comment Utility
First thing I'd do is get a super text-editing tool like UltraEdit and see if there are row delimeters that do not appear in Notepad.

If yes, then build an SSIS data flow where text file is source, specify the delimeters, and destination is a SQL table.
If no, then same data flow but you're likely going to have to dump the entire contents into a single column/value, then use something like STUFF (search EE questions for T-SQL STUFF) to create a set using the VMPIC logic.

Then in SSIS build another data flow with the SQL table as the source, and another file as the destination.

Good luck.
0
 

Author Closing Comment

by:thayduck
Comment Utility
Thanks
0
 
LVL 65

Expert Comment

by:Jim Horn
Comment Utility
Thanks for the grade.  Good luck with your files.  -Jim
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Lessons learned during ten years of interviewing for SQL Server Integration Services (SSIS) and other Extract-Transform-Load (ETL) contract roles and two years of staff manager interviewing contractors.
My client has a dictionary table. They're defining a list of standard naming convention. Now, they are requiring my team to provide us a mechanism how to match new incoming data with existing data in their system.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now