Page 1 of 1

Filter the string data

Posted: Fri Oct 03, 2008 1:09 am
by arshi
Hi,

I have a requirement to filter the 5 character data from the source file and load the data into Target.Source data will provide in text file with pipe delimeter.How to impliment this logic and is there any function available in datastage.

Datastage: Server edition(7.X)
Source: Text File(Pipe delimetr)

Regards,
Arshi

Posted: Fri Oct 03, 2008 1:52 am
by ray.wurlod
Sequential File stage with pipe character ("|") specified as the field separator.

Posted: Fri Oct 03, 2008 2:51 am
by arshi
Ray,

Once importing data into sequential file,how to build the mentioned filter logic(to filter the 5 character data from the source file ) .Can you give the solution for this.

Posted: Fri Oct 03, 2008 3:49 am
by ray.wurlod
What do you mean by "filter"?

Posted: Fri Oct 03, 2008 4:13 am
by arshi
Hi,

One of my source column data having the word 'Index' (this word is part of the Text).If the 'Index' word occured then I want to remove that particular row while populating to the Target.

I am trying with 'Matches' function.But unable to get the solution.

Regards,Arshi

Posted: Fri Oct 03, 2008 4:54 am
by ray.wurlod
Funnily enough you need the Index() function.

Code: Select all

Index(InLink.TheString, "Index", 1) = 0
can be your constraint expression.

You *could* use Matches but need to specify the wildcard characters correctly.

Code: Select all

Not(InLink.TheString Matches "...'Index'...")

Posted: Fri Oct 03, 2008 7:50 am
by arshi
Its working fine by using Index() function

Thanks,
Arshi

Posted: Fri Oct 03, 2008 3:53 pm
by ray.wurlod
Please mark this thread as Resolved using the green button at top.