I have a text File with following format ( HED - Header Row, CL-Data (Sample 3 Rows) , TRL-Trailer Row)
CL 012352908607309000014090 2010-03-04 16:12:53.077000000 Inserted / Log ICode Action on Order Number / 33949591 / with / I-Code / IDEC/ / Memo: / cci questions about alert/
CL 012352958107309000020378 2010-04-14 10:20:03.340000000 Inserted / Log ICode Action on Order Number / 36992594 / with / I-Code / ISRB,INEW,ILKD/ / Memo: / cci to cxl, saved with benefits and gave her instructions to move
CL 012353013807309000021681 2009-11-24 17:09:05.973000000 Inserted / Log Customer Info Change Action CL 012353013807309000021681 2009-11-24 17:09:05.973000000 Updated / Log Customer Info Change Action
I have to Import The above Mentioned data in to Following Table
CREATE TABLE [dbo].[Log]
[Type] [varchar](3) NULL,
[Number] [varchar](14) NULL,
[Customer_ID] [varchar](10) NULL,
[CallDateTime] [varchar](30) NULL,
[Info] [varchar](5000) NULL
If you pay Attention to data It has Fixed width and as well as '\' After Inserted
I need data mapped just like I mentioned in below Example
For an Instance: Data Should Map like this
Type ( Column Width is 3) - CL
Number ( Column Width is 14) - 01235290860730
Customer_ID ( Column Width is 10) - 9000014090
CallDateTime ( Column Width is 30) - 2010-03-04 16:12:53.077000000
Info (Column Width is 5000/MAX) - Inserted / Log ICode Action on Order Number / 33949591 / with / I-Code / IDEC/ / Memo: / cci questions about alert/
When I tried to use Fixed Width. Data is Sitting appropriately in their respective columns Except the Info Column data.
What Should I do to make the above formatted text file data to load in to Table? How to convert from unformatted to formatted text file?
Please Help Me with your suggestions Or With a Solution To fix this issue. Thank you Read more...