Solved

Parse file to individual records

Posted on 2014-10-30
3
98 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

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.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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…

732 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