Page 1 of 1

Data needs to change

Posted: Tue Jun 02, 2009 10:58 pm
by Sourav
Hi ,

I have a source records like
USG12320090403145343NES2_Erc_VTTF2972.data but i need only
NES2_Erc portion . so kindly help me

Posted: Tue Jun 02, 2009 11:02 pm
by arvind_ds
Do you have all the source records of fixed length.? Is the position of NES2_Erc string same across all the records.? If yes, then use left and right functions to cut the desired portion from the input string(s).

HTH

Data needs to change

Posted: Tue Jun 02, 2009 11:13 pm
by Sourav
This records are not fixed length and all records are different and USG12320090403145343 records are fixed with NES2_Erc string [ Only applicable for this records ] .
I am given you another records like USG10420090515091147HYD_MSS3_VTTF9741.data .

Kindly help me .
arvind_ds wrote:Do you have all the source records of fixed length.? Is the position of NES2_Erc string same across all the records.? If yes, then use left and right functions to cut the desired portion from the input string(s).

HTH

Posted: Tue Jun 02, 2009 11:41 pm
by ray.wurlod
This is very easy with MatchField() functions and concatenation in a BASIC Transformer stage.

If you know that there are always four characters before the first underscore, then there is a solution using Index() and substrings.

Posted: Wed Jun 03, 2009 1:13 am
by dspxlearn
It seems you are getting date timestamp before your string.

USG12320090403145343NES2_Erc_VTTF2972.data
USG10420090515091147HYD_MSS3_VTTF9741.data

Code: Select all

If this is always the same case, you could probably use something like Col1[21,Len(Field(Col1,'_',2))]

Col1 --> Your source column in Varchar format