Solved

Parse file to individual records

Posted on 2014-10-30
3
96 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
backup job space check 4 41
TSQL Challenge... 7 35
TSQL convert date to string 4 34
Select statement with COUNT (SQL Server) and return records that have 0 count as well 13 21
My client sends a request to me that they want me to load data, which will be returned by Web Service APIs, and do some transformation before importing to database. In this article, I will provide an approach to load data with Web Service Task and X…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to shrink a transaction log file down to a reasonable size.

808 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