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 12»»

Removing certain text from a column Expand / Collapse
Author
Message
Posted Wednesday, July 30, 2014 3:02 AM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:36 AM
Points: 119, Visits: 195
Hi
i have been asked to do the following
b. If Asset Type = ‘IRS’ or ‘IFS’
i. Remove any leading text ‘IRS: Flo/Fix: ‘ or ‘IRS: Fix/Flo: ‘ or ‘INF SWAP: Flo/Fix: ‘ or ‘INF SWAP: Fix/Flo: ‘ or ‘IFS: INF: ‘ or ‘IFS: Flo/Fix: ‘ or ‘INF SWAP: Flo/Fix ‘
ii. Remove the proceeding text that starts with ‘ACT’


here is some example data from column


IRS: Fix/Flo: EUR FIXED 2.2795% ACT/ACT ANNUAL VS FRCPI ACT/365 24DEC22
IRS: Fix/Flo: EUR FIXED 2.59% 30/360 VS FLOATING FRCPI Index ACT/360 17Jan23
127869-IRS: Flo/Fix: P140000000EUR IrregularSpd 0% R14000000
IFS: INF: EUR Fixed 1.955% VS FRCPXTOB Index ACT/365 15Nov23
INF SWAP: Flo/Fix EUR Fixed 1.8475% 30/360 VS CPTFEMU ACT/360 21Nov25
138761-IRS: Flo/Fix: P107000000EUR IrregularSpd 0% R107000000EUR
139863-IRS: Fix/Flo: EUR Irregular@1.04% EUR IrregularSpd 0% (13/03/14-13/03/17)
140384-IRS: Flo/Fix: P138639000EUR IrregularSpd 0% R138639000EUR Irregular@1.745% (18/03/14-18/03/26)


Post #1597622
Posted Wednesday, July 30, 2014 3:12 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 7:23 AM
Points: 5,074, Visits: 11,852
OK. Problem?


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 #1597627
Posted Wednesday, July 30, 2014 3:14 AM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:36 AM
Points: 119, Visits: 195
im new to ssis so i dont really know how i can do this, so looking for advice help to do this
Post #1597628
Posted Wednesday, July 30, 2014 3:16 AM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:36 AM
Points: 119, Visits: 195
im new to ssis so i dont really know how i can do this, so looking for advice help to do this
Post #1597629
Posted Wednesday, July 30, 2014 3:28 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 7:23 AM
Points: 5,074, Visits: 11,852
What is the nature of this data - a flat file?

And you want to clean the data as part of an import to a db - is that right?



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 #1597630
Posted Wednesday, July 30, 2014 3:41 AM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:36 AM
Points: 119, Visits: 195
sorry should have stated that but yes you have it spot on it reads in a flat file then i clean it up and into a db table
Post #1597632
Posted Wednesday, July 30, 2014 6:14 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 7:23 AM
Points: 5,074, Visits: 11,852
It's going to be tricky for a newbie, because the data seems to vary by 'type' and some techniques are required to get you through that.

Do you know what your intended output columns are? Do they vary by record type?



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 #1597675
Posted Wednesday, July 30, 2014 7:13 AM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:36 AM
Points: 119, Visits: 195
yes its just going from 1 column in flat file to 1 column in a table just with the new fix up data.
so say its security name in the flat file and there is a column in table called security name and thats where it will end up depending on if it match the assetType= "ifs"
asset type is a different column all right
Post #1597708
Posted Wednesday, July 30, 2014 7:18 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 7:23 AM
Points: 5,074, Visits: 11,852
ronan.healy (7/30/2014)
yes its just going from 1 column in flat file to 1 column in a table just with the new fix up data.
so say its security name in the flat file and there is a column in table called security name and thats where it will end up


OK, great - so we're just dealing with a piece of text.

But imagine a single table full of these text chunks - not that useful, surely? So...

Will the target table have other stuff in it?

If so, how will you know which target row to update, based on the source data?



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 #1597710
Posted Wednesday, July 30, 2014 7:23 AM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:36 AM
Points: 119, Visits: 195
every column in flat file has a coulmn connected to it in the db table.

and i have actually made a mistake. they way i was doing it is i read in flat file and that goes to a temp table. then from that table to my production table is where i want these changes to occur. does this make it any easier. sorry again for leaving this part out i thought it was coming straight from flat file source.


so it will go to the assettype column look up the word IFS and if it finds it makes the changes and enters it into new table
Post #1597715
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse