Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find String in unformatted flat file

Status
Not open for further replies.

Ringers

Technical User
Feb 26, 2004
180
AU
SSIS 05

Hi All,
I am trying to find a string "BOS" in a un-formatted flat file (it's a generated log file .txt), using SSIS to automate it. It doesn't have comma's or tab spacing it only has [CR LF]. So the data gets imported as one column with many rows and the odd empty row. I then use a conditional split to search for the string but all the rows end up going to the default output. When I use a plain text file with just the string the package works fine. But when I use log file it doesn't find.

Is it possible to use a UN-formatted flat file in SSIS and if so how?

Conditional split code:

Order 1, FINDSTRING("BOS",[Copy of Column 0],1)>0

Order 2, [Copy of Column 0] == "BOS" || SUBSTRING([Copy of Column 0],1,500)=="BOS"

File:

Begin Processing of excel file: Phils Inc.xls 31-08-12 08-16-58 CRLF
Excel File: Phils Inc.xls opened successfullyCRLF
WorkSheet set successfullyCRLF
Header row loaded successfullyCRLF
Mapping established beginning processing of invoicesCRLF
CRLF
Processing Invoice: 8957CRLF
Processing LineItem: 1, Line Reference: , Excel Row: 2CRLF
The following Invoice: 8957 could not be processed due to An error has occurred intialising the BOS object. For further information please see the attached error.CRLF
The following LineItem: 1, Line Reference: , Excel Row: 2 could not be processed due to An error has occurred intialising the BOS object. For further information please see the attached error.CRLF
CRLF
Processing Invoice: 019CRLF
Processing LineItem: 1, Line Reference: , Excel Row: 3CRLF
The following Invoice: 019 could not be processed due to An error has occurred intialising the BOS object. For further information please see the attached error.CRLF
The following LineItem: 1, Line Reference: , Excel Row: 3 could not be processed due to An error has occurred intialising the BOS object. For further information please see the attached error.CRLF
CRLF
Processing Invoice: 007895CRLF
Processing LineItem: 1, Line Reference: 20059, Excel Row: 4CRLF
Processing LineItem: 2, Line Reference: 20057, Excel Row: 5CRLF
The following Invoice: 007895 could not be processed due to An error has occurred intialising the BOS object. For further information please see the attached error.CRLF
The following LineItem: 1, Line Reference: 20059, Excel Row: 4 could not be processed due to An error has occurred intialising the BOS object. For further information please see the attached error.CRLF
The following LineItem: 2, Line Reference: 20057, Excel Row: 5 could not be processed due to An error has occurred intialising the BOS object. For further information please see the attached error.CRLF
CRLF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top