Solved

Parse file to individual records

Posted on 2014-10-30
3
91 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
ID: 40413280
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
ID: 40440749
Thanks
0
 
LVL 65

Expert Comment

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

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

My client sends data in an Excel file to me to load them into Staging database. The file contains many sheets that they have same structure. In this article, I would like to share the simple way to load data of multiple sheets by using SSIS.
Here's a requirements document template for an integration project (also known as Extract-Transform-Load or ETL) based on my development experience as an SQL Server Information Services (SSIS) developer over the years.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

785 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