Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Regarding FindString() Expand / Collapse
Author
Message
Posted Thursday, December 10, 2009 12:22 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, January 21, 2010 2:11 AM
Points: 20, Visits: 24
Hi,

Anyone know how to seperate tab delimited data using FindString() Function. I got the data from flat file and in conditional split i want to split the tab delimited data into one file.

Please help me on this issue.

Thanks,
Jags
Post #832015
Posted Thursday, December 10, 2009 12:26 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 9:16 PM
Points: 37,102, Visits: 31,655
Why don't you split it on the way in? I'm no SSIS wizard, but I believe they have a BULK task of some sort to load and split files on the way in.

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #832017
Posted Thursday, December 10, 2009 12:30 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, January 21, 2010 2:11 AM
Points: 20, Visits: 24
Hi,

Here actually i am getting the data from script and by using conditional split i want to verify the excact data with tab delimited and save those data into seperate file. If any data not having tab delimited then save those data into another file.

So can you suggest me how can i do this.

Thanks,
Jags
Post #832023
Posted Thursday, December 10, 2009 12:35 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, January 21, 2010 2:11 AM
Points: 20, Visits: 24
Hi,

Like this i am verifying the pipe delimited data using findstring function.

FINDSTRING(AllRowColumns,"|",9) != 0

I want to verify this using tab delimited instead of pipe. What should i do here in that function.

Thanks,
Jags
Post #832027
Posted Thursday, December 10, 2009 12:52 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 9:16 PM
Points: 37,102, Visits: 31,655
I'm not sure what it is in SSIS but, in T-SQL, CHAR(9) is the tab character. In some places, it may be just \t or "\t".

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #832031
Posted Thursday, December 10, 2009 1:00 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, January 21, 2010 2:11 AM
Points: 20, Visits: 24
Hi Jeff,

Yes Char(9) is used for tab delimited in script but here it is not working and /t also not working.

I think i need to do more search on this.

Thanks,
Jags
Post #832032
Posted Thursday, December 10, 2009 7:08 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 9:16 PM
Points: 37,102, Visits: 31,655
Sorry Jags... I just don't know that much about SSIS. Hopefully, someone will see this and lend a hand.

As a sidebar, I typically do this type of stuff in T-SQL using BULK INSERT and other tools.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #832187
Posted Thursday, December 10, 2009 9:00 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, April 11, 2014 7:30 AM
Points: 346, Visits: 518
jagadeeshb (12/10/2009)
Hi,

Here actually i am getting the data from script and by using conditional split i want to verify the excact data with tab delimited and save those data into seperate file. If any data not having tab delimited then save those data into another file.

So can you suggest me how can i do this.

Thanks,
Jags



You can use native SSIS capability to do this very easily. Use a flat file source system to point to your source file. While defining the connection manager - column tab - mention that the column delimeter is tab{t} from drop-down.

If you have a fairly correct formatted source file - you should be able to see the preview.

Now right click on the flatfile source component - to go to advance editor - go to 'Input & Output properties' and configure flatfile source error output...

You can redirect 'bad' rows to the output and good rows to another output.

See the following for more help:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=101225

(this should resolve your requirement)

Fore more :

http://www.bimonkey.com/2009/06/flat-file-source-error-the-column-delimiter-for-column-columnname-was-not-found/
http://www.sqlservercentral.com/Forums/Topic666292-148-1.aspx

Let me know how it goes..



--
Sabya
Post #832308
Posted Thursday, December 10, 2009 9:20 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, September 15, 2014 7:23 AM
Points: 5,074, Visits: 11,852
--Removed


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #832331
Posted Saturday, December 21, 2013 1:45 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, September 10, 2014 12:40 PM
Points: 141, Visits: 854
My 2c...
Was having the same problem and found that:
FINDSTRING([Input],"\t",1)


...worked just fine
Post #1525248
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse