Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
How i can remove the extra string/caracter from column using tmap.
Need to remove till 00:00:00 if exist else ignore.
Colum1
28SEP 00:00:00 120
33
20DEC 00:00:00 24
Expected output.
colum1
120
33
24
Thanks
Shree
Here is a solution:
And the result:
Starting job test at 15:33 14/11/2017. [statistics] connecting to socket on port 4011 [statistics] connected .-----------+-----+-----+----. | tLogRow_13 | |=----------+-----+-----+---=| |col1 |col2 |col3 |col4| |=----------+-----+-----+---=| |CAID:A70-01|M-001|35/MA|90 | |CAID:A70-01|M-001|37/MA|51 | '-----------+-----+-----+----' [statistics] disconnected Job test ended at 15:33 14/11/2017. [exit code=0]
Hi @TRF,
I am getting java.lang.NullPointerException.
Both source and target are string data types.
Thanks
Shree
Hi,
You have to probably handle null before writing the function.
Regards
Prasoon
Try using this one:
row1.column1 != null ? row1.column1.replaceAll ("^.*00:00:00 ", "") : null
Thanks @TRF,
It's working now, there little change in the requirement. I am concatenation some columns then i want split single columns into mutiple columns.
Source:
Colu1 , col2
01SEP00:00:00CAID:A70-01MAM-001, 004935/MA90
CAID:A70-01MAM-001, 37/MAA/MA51
Expected output:
Col1 col2 col3 col4
CAID:A70-01 M-001 35/MA 90
CAID:A70-01 M-001 37/MA 51
Rules:
colu1:
1) remove all character before CAID.
2) CAID:A70-01: Lenght of the character is fixed.
3) M-001: Lenght of the character is fixed.
Col2:
1) Point posiition "/". Extract before "/" 2 digit i,e 35 and 37.
2) /MA : is fixed two digit.
3) 90: varience is charcter: curretly consider two digits.
Thanks
Shree
You should check how regex work with Java with the following link:
http://www.vogella.com/tutorials/JavaRegularExpressions/article.html
Should probably be easier using a tJavaRow than a tMap to solve your case.
Hi @TRF,
Sure, Currently i am in middle logic.
Would be great if help me using tmap only.
Thanks
Shree
Here is a solution:
And the result:
Starting job test at 15:33 14/11/2017. [statistics] connecting to socket on port 4011 [statistics] connected .-----------+-----+-----+----. | tLogRow_13 | |=----------+-----+-----+---=| |col1 |col2 |col3 |col4| |=----------+-----+-----+---=| |CAID:A70-01|M-001|35/MA|90 | |CAID:A70-01|M-001|37/MA|51 | '-----------+-----+-----+----' [statistics] disconnected Job test ended at 15:33 14/11/2017. [exit code=0]