Solved

Parse file to individual records

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

920 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

15 Experts available now in Live!

Get 1:1 Help Now