top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

PowerCenter - Regular Expressions

+1 vote
172 views

I got the following regular expression:

=([^"]*)

Basically I want to extract a value between = and " (example: "City=Paris", output "Paris"). But for some reason this expression wont work in PowerCenter.

You got any idea how to implement it?

Thank you

posted Nov 6, 2014 by Sachin

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

You can try this

REG_EXTRACT('"City=Paris"','(.*\w+=)(\w+)(".*)',2)

This basically breaks up the string in three groups of characters and returns the second group.

answer Nov 7, 2014 by Shweta Singh
Similar Questions
+1 vote

Finding out why a regular expression does not match a given string can very tedious. I would like to write a utility that identifies the sub-expression causing the non-match. My idea is to use a parser to create a tree representing the complete regular expression. Then I could simplify the expression by dropping sub-expressions one by one from right to left and from bottom to top until the remaining regex matches.
The last sub-expression dropped should be (part of) the problem.

As a first step, I am looking for a parser for Python regular expressions, or a Python regex grammar to create a parser from.

But may be my idea is flawed? Or a similar (or better) tools already exists? Any advice will be highly appreciated!

0 votes

I have one source table as :

S1       S2       S3       S4
 Hi      There    SSN1     SSN2 

where S1, S2, S3 and S4 are column names.

There is a target table likewise which has three fields:
T1 T2 T3

I have another table which is as follows:

Function            Target_Column
 concat(S1,S2)          T1
 substr(S3,1,3)         T2
 substr(S3,3,1)         T3 

I want to have such a mapping in which it can fetch the function name and map according to the function present in the table to the target column specified. My target table now after running the mapping will be:

T1         T2       T3
 HiThere   SSN       1

How can I achieve this?

+1 vote

In Informatica's PowerCenter, is it possible to set a parameter's value based on the output of a stored procedure? The parameter I want to set is a parameter I defined in a flat-file data object.

0 votes

I have some files that I would like to consolidate into a single database table. The files have similar but different formats. The files look something like this:

FileOne:
•ColA : string
•ColB : string
•ColC : string

FileTwo:
•ColAA : string
•ColBB : string
•ColCC : string

FileThree:
•Col01 : string
•Col02 : string
•Col03 : string

The destination table looks like this:

TableDestination:
•ColFirst : string
•ColSecond : string
•ColThird : string

I want to develop a mapping that ETLs these three files into this one database, but because the column names are different, it looks like I'll have to develop three different mappings, or three different sources, or three different somethings. The problem is that my example is contrived: I actually have many different files that all have different formats and column names, but the data is all very similar.

I would like to develop a single mapping or workflow that can handle all of this by only adding a table that holds the column mappings. Such a table would look like this based on the sample files and sample table above:

TableMappings:
enter image description here

In this way, to edit a column mapping I only have to make an edit this this TableMappings table. I wouldn't have to make any changes at all to the mapping or workflow. Nor would I have to redeploy an application.

What would a mapping or workflow look like that could take advantage of something like this? I assume there'd be a flat file source that takes files from a folder. There would be something in the middle that uses this TableMappings table to map column names. Finally there would be a relational data object that represents my destination database table "TableDestination". I don't know how to put this together though.

0 votes

What are the services which form the Informatica PowerCenter processing engine?

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...