Mapping - Split string separated by value ;
Hi,
I have a mapping where 4 source values makes the key for 1 target value.
In the target string (result after value mapping) i want to get the last value in the string "TargetValue1.
<i>SourceValue1;SourceValue2;SourceValue3;SourceValue4;TargetValue1</i>
Can this be done without UDF? If not how should the UDF look like?
Best Regards
/Claes
Message was edited by:
Claes Widestadh
Hi,
Yes I have concatenated 4 source values into one string to use them as key in a value mapping to get the target value. The result from the value mapping is a string with the 4 source value + the target value. What I want to do now after the value mapping is to spit this string to get only the target value.
The string looks like this
Source sting
example 1) CC;-;ADJ;fre;
example 2) CR;+;ADJH;TD;
Target string:
example 1) CC;-;ADJ;fre;<b>985</b>
example 2) CR;+;ADJH;TD;<b>553</b>
It is the value 985 or 553 that i want to map into the target field. The position for the target value (985, 553) is not a fixed position because of that the length of the source values can vary (see example obove). That means that I cant use the substring right?
/Claes
Message was edited by:
Claes Widestadh
null
null
Similar Messages
-
Splitting string separated by commas into words and assigning numerical values
Project details :
I have a project where a description field is being looked at and based on the values (multiple words) I have to do a vlookup from another spreadsheet to get the dates from the appropriate date fields.
I have created a user defined function to extract keywords from a list from a table. It extracts words from the string separated by comma delimiter.
I am thinking of assigning values something like this: cooler = 1, compressor = 2, frame = 2, change of order = b etc.
So if there is a “cooler, compressor, frame, change of order” in the cell, then it should read as: b12 (unique values). Based on the values, I can do a vlookup on the dates. I tried sumproduct in conjuction with search function but did not
work. Tried split function but did not quite work.
Any help regarding this is greatly appreciated. Thank you, regards
keywords
engine, compressor, frame, cooler =Keywords(Wordlist,A2) is the function I am calling
frame, cooler
engine, cooler, change order
coolerHi,
You're asking this question in the wrong forum, this is a PowerShell forum.
The Excel VBA forum is this way:
http://social.msdn.microsoft.com/Forums/en-us/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
Side note to whoever voted up the OP - why??
Don't retire TechNet! -
(Don't give up yet - 12,950+ strong and growing) -
I have a requirement to take a String column that allows multiple fields i.e. "101;102,103,104",
and using a SPD 2013 workflow I want to split there values and then insert each Values into different list as separate items.
Eg:
I have a LIST A with the columns CustID, CustName and LIST B with the same Column Name with the below values
LIST A:
Cust ID
CustName
101
ABC, XYZ, CTSS, WIPROS, TCSS
I want to insert the above comma separated values in the below format(different Row)
LIST B:
CustID
CustName
101
ABC
101
XYZ
101
CTSS
101
WIPROS
101
TCSSHi,
Here is a codeplex solution can meet your reference:
Plumsail String Workflow Actions for SharePoint 2013 and SharePoint Online
http://spworkflowactions.codeplex.com/
We can use Split string workflow action to split the CustName value, then insert it to ListB.
More information:
http://www.codeproject.com/Articles/749471/String-processing-workflow-actions-for-SharePoint
Best Regards
Dennis Guo
TechNet Community Support -
Check for null values in string, if no values, print blank
Hi
I posted a question a few days back, after playing with functions I was able to resolve it, I just have one more problem, if the string comes empty, only blank spaces should be printed, following is my string and my fix:
My string:
SEV.ORI/999999.VIN/1D7Hx11111111111111.VYR/2005.VMA/DODG.VMO/THU.DOT/07072013.CRT/MI1111111.OCA/11111111890123000001.LIT/PC.LIC/BFK9331
=Left(Split(Fields!MESSAGE.Value,"/")(6),2) + "/"
& Mid(Split(Fields!MESSAGE.Value, "/")(6) ,3 ,2) + "/"
& Mid(Split(Fields!MESSAGE.Value, "/")(6), 5, 4)
With this I get: 07/07/2013
If DOT comes empty, i get .CRT/
So I need to validate for empty space on DOT and print blank spaces. I'm guessing it would be with an IIF
or IsNothing function. Any help would be appreciated.Hi
Again after a few hours of playing with functions I resolved the issue, I will post the fix in case it can help someone else.
String:
M00836Z911134.SEV.ORI/MI3987656.VIN/1XXXXXXXXXXXXXX88.VYR/XXXX.VMA/FORD.VMO/THU.DOT/01192013.CRT/MIXX11XX0.OCA/XXXXXXXXXX123000XXX.LIT/PC.LIC/XXXXXXX.
Function:
=IIF(Mid(Split(Fields!MESSAGE.Value, ".")(7) ,1 ,3) = "DOT" , Mid(Split(Fields!MESSAGE.Value, ".")(7) ,5 ,2) + "/"
+ Mid(Split(Fields!MESSAGE.Value, ".")(7) ,7 ,2) + "/"
+ Mid(Split(Fields!MESSAGE.Value, ".")(7) ,9 ,4)," ")
Result:
01/19/2013
If DOT is missing, the space in the report comes blank -
HELP URGENT:; Splitting strings in servlets
hi ...
I am trying to access the below servlet from another servlet in iplanet . I have to access a file and arrange the '|' delimited data in the file in a table format like in html ...
I have used my own function inside the servlets which splits a string based on character ...But I always get
Internal error: exception thrown from the servlet service function (uri=/servlet/ReportsDataServlet): java.lang.NullPointerException, Stack: java.lang.NullPointerException
at ReportsDataServlet.split(ReportsDataServlet.java:82)
at ReportsDataServlet.doPost(ReportsDataServlet.java:56)
at ReportsDataServlet.doGet(ReportsDataServlet.java:14)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:919)
at com.iplanet.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:483)
The sample code is shown below....I get the same error when i tries with stringokenizer as well....Pls help me fix this.....
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, Se
rvletException
response.setContentType("text/html");
PrintWriter out = response.getWriter();
cont=getServletContext();
out.println("<html><head><title>Reports Data</title></head><body bgcolor=DBD0E2>");
String repType = request.getParameter("Rep");
String mon = request.getParameter("month");
String day = request.getParameter("day");
String year = request.getParameter("year");
String repName = repType+"."+mon+"-"+day+"-"+year+".txt";
BufferedReader in = new BufferedReader( new FileReader("/home/lnayar/baais/xmlServlet/"+rep
Name));
String st;
st = in.readLine();
cont.log(st);
int c =0;
out.println("<table border=\"3\" cellpadding=\"0\" cellspacing=\"0\" width=\"800\"><tr><td>L
ATA</td><td>WC CLLI</td><td>WC NAME</td><td>ADSL_LOCATION</td><td>ATM FLAG</td><td>ATM RELIEF DATE</td><t
d>FRAME FLAG</td><td>FRAME RELIEF DATE</td><td>GOLD FLAG</td><td>GOLD RELIEF DATE</td><td>OVERLAY INDICAT
OR</td><td>COUNT</td></tr>");
while (st != null)
c++;
st = in.readLine();
StringTokenizer stt = new StringTokenizer(st);
out.println("<tr>");
while (stt.hasMoreTokens())
//out.println("<td>"+stt.nextToken("|")+"</td>");
out.println("<td>hello</td>");
out.println("</tr>");
while (st != null)
c++;
st = in.readLine();
out.println("<tr>");
Enumeration en = split(st,"|");
while(en.hasMoreElements())
out.println("<td>"+en.nextElement()+"</td>");
out.println("</tr>");
cont.log("out while");
out.println("</table>");
out.println("</body></html>");
public Enumeration split (String str, String delim)
Vector v = new Vector();
int pos_1;
int pos_2;
//Set initial delimiter positions...
pos_1 = 0;
pos_2 = 0;
//Start chopping off bits from the string
//until left boundary reaches the length of string
while ( pos_1 <= str.length() )
pos_2 = str.indexOf(delim, pos_1);
if ( pos_2 < 0 )
pos_2 = str.length();
String sub = str.substring (pos_1, pos_2);
pos_1 = pos_2 + 1;
v.addElement(sub);
return v.elements();
d deeply appreciate if soeone could take a look at the code and tell me exactly where i am going wrong ..... Its URGENT ...
Thx
klvBut there is the while statement which filters null
values..Which is useless in your case, because you proceed to change the value of st to something else which you don't check for null.
At any rate, what you have to do is this:
1. Look at the stack trace to find the line number where the error occurs.
2. Look at that line in your code.
3. Look at each object variable in that line. Find out how it became null and fix that. -
Mapping Help for replacing source value
Mapping Help for replacing source value
Posted: Mar 14, 2006 1:06 AM Reply
Hi all,
I am unable to do transform the source value to required target value,
From Source ADDRESS_TYPE = 'HOME' should be replaced with 03 to target field ANSSA, and 'MAIL' to be replaced with 05, I am trying to do it but i am unable to handle it, please give u r valuable suggestions,
The source structure is like this,
- <Event ID="239" TRANS_TYPE="ADR">
<PersAddr GEO_LOC_CD="US" EMPLID="29" ADDRESS_TYPE="HOME" EFFDT="02/15/2006" ADDRESS1="92nd Floor" ADDRESS2="812backstreet" ADDRESS3="" ADDRESS4="" CITY="London" COUNTY="" STATE="AN" POSTAL="EC2N 4AG1" COUNTRY="GBR" KEY1="29" KEY2="HOME" KEY3="02/10/2006" />
<PersAddr GEO_LOC_CD="US" EMPLID="29" ADDRESS_TYPE="MAIL" EFFDT="02/15/2006" ADDRESS1="92nd Floor" ADDRESS2="812backstreet" ADDRESS3="" ADDRESS4="" CITY="London" COUNTY="" STATE="AN" POSTAL="EC2N 4AG1" COUNTRY="GBR" KEY1="29" KEY2="MAIL" KEY3="02/10/2006" />
</Event>
REGARDS,
sridharHi,
This can be done using user-defined function as well.
Code the function as...
if(Addr_Type.equals("HOME"))
return "03";
else if(Addr_Type.equals("MAIL"))
return "05";
else
return "Invalid Address Type";
Here, Addr_Type is Input String Argument for this function.
Map this function between ADDRESS_TYPE and ANSSA.
Regards,
Uma -
Hi All,
Is there a FM available which can split string based on seprator e.g ABC XYZ needs to be separated using space delimeter.
Thanks!
Prakash D. Naikif you dont know the number of occurrences of the delimeter you can use the following code.
data: source type string ,
target type standard table of string .
source = 'This is for test.' .
split source at ' ' into table target .
Regards
Raja
PS Kindly post ABAP related questions at
ABAP Development -
I've been searching online, and haven't been able to find a definitive answer to this. Does anyone know what the following SharePoint 2013 Search Service Application, Crawled property category option does?
"Map all string properties in this category to the Content managed property"
It appears when editing a crawled property category.Hi Vishal,
There is no Official documentation explaining the setting "Map all string properties in this category to the Content managed property". In my opinion, this setting will map all crawled properties which are in current category and
whose value is string type to the Content managed property.
Thanks,
Eric
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
Function module to split strings
Hi,
I have a string value ' DBTABLE-FIELDNAME'. I need to split this into 2 strings - The first one is the database table name and the second one is the fieldname. So, the character '-' is the point where the split needs to be done. How can this be achieved. Any FM that I could use?
Thanks for your help!
Regards,
Divyaman Singh RawatUse FM 'STRING_SPLIT'
REPORT ZEXAMPLE.
DATA: V_HEAD(10), V_TAIL(10).
PARAMETERS: P_STR(20),
P_DEM.
CALL FUNCTION 'STRING_SPLIT'
EXPORTING
DELIMITER = P_DEM
STRING = P_STR
IMPORTING
HEAD = V_HEAD
TAIL = V_TAIL
EXCEPTIONS
NOT_FOUND = 1
NOT_VALID = 2
TOO_LONG = 3
TOO_SMALL = 4
OTHERS = 5.
IF SY-SUBRC EQ 0.
WRITE:/ 'HEAD:', V_HEAD,
/ 'TAIL:', V_TAIL.
ELSE.
WRITE:/ 'ERROR SPLITTING STRING'.
ENDIF.
Regards,
Joy. -
Split string into two based on end of word and max length
I have the following procedure, which is passed a comma separated string as it input, and it has to split it into two, and the split has to occur at the end of a word, and the first split part can't be more than 15 in length.
Is there an more efficient way of achieving this? I have a loop in my main code that calls this procedure and in effect a nested loop has been created here.
e.g. Hello, everyone, welcome, to, split, string' would be split into 'Hello' and 'everyone, welcome, to, split, string'
create or replace procedure split_str
(pi_str in varchar2,
po_str1 out nocopy varchar2,
po_str2 out nocopy varchar2) is
i number;
begin
if (len(pi_str) <= 15) then
po_str1 := pi_str;
po_str2 := NULL;
else
i := 1;
loop
exit when len(SUBSTR(pi_str, 1 ,INSTR(pi_str, ',', 1, i)-1)) > 15;
po_str1 := SUBSTR(pi_str, 1 ,INSTR(pi_str, ',', 1, i)-1);
po_str2 := SUBSTR(pi_str, INSTR(pi_str, ',', 1, i)+2);
i := i+1;
end loop;
end if;
end split_str;You want to find the last space character before the 15th character.
x := INSTR ( SUBSTR ( pi_str, 1, 15) , ' ' , -1)Then the first string is SUBSTR(pi_str,1,x) and the second string is SUBSTR(pi_str,x+1) -
Easiest way to split a floating point value
Hello, I am trying to split a floating-point value (double) into its fractional and integer parts? I have been trying to find some sort of method in BigDecimal or Double that would do it but so far I haven't come up with anything. I know it could be done by searching through it as a String but that sounds like a very inefficent way to do it. I would appreciate any help you could give. Thanks
float f;
int i = (int) f;
float frac = f-i; -
Hi!
How do I map a String[] in a CMP-EJB2.0 ? I know of two methods that doesn't seem very good in my eyes.
1) Create an EJB that represents the String and then map a relation between the two EJB:s
2) Use a Blob as a datatype for my String[].
The second way isn't really an alternative since I already have data in an existing table structure and for the first one it feels quite backward to have an EJB for each String in the String[].
Is there a way to map a "helper" table for my String[]?
Thanks in advance
Roland CarlssonHi and thanks for your answer.
The tables look like this:
Master:
id String
// 8 more columns
Slave:
id String
value String
Master.id is primary key
Slave.id and Slave.value is primary key together.
Slave.id has a foreign key in Master.id
So, can I read the data into my EJB (master) without having to create another EJB ?
Thanks in advance
Roland Carlsson -
Hello,
Does anyone know a standard string FM that split string at an absolut place and consider if the N place is blank or not ?
My meaning is likely:
str = 'test one two three'.
I would like to split str at the 10th place but because it's in a middle of word split it in the 8th place ..
str1 = 'test one'
str2 = 'two three'
and not
str1 = 'test one t'
str2 = 'wo three'
I know that VB has few methods like that, I'm hope abap has it also ..
Thanks in advance,
RebekaHi Rebeka,
Please check the following code. This would help. FM 'TEXT_SPLIT' does it correctly.
DATA: text(50) TYPE c VALUE 'test one two three',
text1(20) TYPE c,
text2(20) TYPE c.
CALL FUNCTION 'TEXT_SPLIT'
EXPORTING
LENGTH = 10
TEXT = text
AS_CHARACTER =
IMPORTING
LINE = text1
REST = text2
check sy-subrc = 0.
write : text1 ,
text2.
Reward points if useful.
Regards
Abhishek -
Distinguishing between empty string and null values
hi all,
I am using an ODBC connection to connect my java app to database using JDBCODBC driver. I have 2 columns 'aColumn' and 'bColumn' in my table, both allow null values. I have one row in it, which has null value in aColumn and empty string in bColumn. I retrieve this row's data and assign it to 2 columns : 'aColumnVar' and 'bColumnVar' respectively. I find out that both 'aColumnVar' and 'bColumnVar' variables has null values (although bColumnVar should has an empty string as its value). Now my ODBC connection Data Source has the option "Use ANSI nulls, paddings, and warnings" ON. I turn it off and try again. This time both 'aColumnVar' and 'bColumnVar' variables has empty string as values (although aColumnVar should has null as its value).
How can I make sure that i can get the data exactly as it is in the database in my variables?
Thanksthere is a wasNull() method on ResultSet. After you
have obtained the value of a column e.g. by calling a
method like getString you can call wasNull and if it
returns true then the value on the database is null.
Check the java docs, it might explain it better
http://java.sun.com/j2se/1.4.1/docs/api/java/sql/Result
et.html#wasNull()I am using MS SQL Server 7.0 under Windows NT 4.0 with JDK 1.2. My ODBC connection Data Source has to have the option "Use ANSI nulls, paddings, and warnings" ON.
I try the wasNull() method but it is doing the same thing i.e. telling me that a column is null when in database it is null (right); and a column is null when in database it is an empty string (wrong). I suspect it is something to do with the JDBC-ODBC driver I am using. -
How Can I replace newScale Text Strings with Custom Values?
How Can I replace newScale Text Strings with Custom Values?
How can I replace newScale text strings with custom values?
All newScale text is customizable. Follow the procedure below to change the value of any text string that appears in RequestCenter online pages.
Procedure
1. Find out the String ID of the text string you would like to overwrite by turning on the String ID display:
a) Navigate to the RequestCenter.ear/config directory.
b) Open the newscale.properties file and add the following name-value pair at the end of the file:res.format=2
c) Save the file.
d) Repeat steps b and c for the RmiConfig.prop and RequestCenter.prop files.
e) Stop and restart the RequestCenter service.
f) Log in to RequestCenter and browse to the page that has the text you want to overwrite. In front of the text you will now see the String ID.
g) Note down the String ID's you want to change.
2. Navigate to the directory: /RequestCenter.ear/RequestCenter.war/WEB-INF/classes/com/newscale/bfw.
3. Create the following sub-directory: res/resources
4. Create the following empty text files in the directory you just created:
RequestCenter_0.properties
RequestCenter_1.properties
RequestCenter_2.properties
RequestCenter_3.properties
RequestCenter_4.properties
RequestCenter_5.properties
RequestCenter_6.properties
RequestCenter_7.properties
5. Add the custom text strings to the appropriate RequestCenter_<Number>.properties file in the following manner (name-value pair) StringID=YourCustomTextString
Example: The StringID for "Available Work" in ServiceManager is 699.
If you wanted to change "Available Work" to "General Inbox", you would add the following line to the RequestCenter_0.properties file
699=General Inbox
Strings are divided into the following files, based on their numeric ID:
Strings are divided into the following files, based on their numeric ID:
String ID File Name
0 to 999 -> RequestCenter_0.properties
1000 to 1999 -> RequestCenter_1.properties
2000 to 2999 -> RequestCenter_2.properties
3000 to 3999 -> RequestCenter_3.properties
4000 to 4999 -> RequestCenter_4.properties
5000 to 5999 -> RequestCenter_5.properties
6000 to 6999 -> RequestCenter_6.properties
7000 to 7999 -> RequestCenter_7.properties
6. Turn off the String ID display by removing (or commenting out) the line "res.format=2" from the newscale.properties, RequestCenter.prop and RmiConfig.prop files
7. Restart RequestCenter.
Your customized text should be displayed.I've recently come across this information and it was very helpful in changing some of the inline text.
However, one place that seemed out of reach with this method was the three main buttons on an "Order" page. Specifically the "Add & Review Order" button was confusing some of our users.
Through the use of JavaScript we were able to modify the label of this button. We placed JS in the footer.html file that changes the value of the butt
Maybe you are looking for
-
In iPhoto, how do I create a new library?
I can't seem to figure out how to create a new library within iPhoto ...
-
Facetime not working on iPad Retina Display
As many of the others here have posted, Facetime isn't working on my brand-new iPad. It works on my phone and on my Mac through my email address and mobile phone number, but not on the iPad. TEXAS MAC MAN I have already looking through the links that
-
JDialog.... functionality lost
Hi, I have created a Frame that consist of 2 JPAnels. I haev a button one one of the JPanel that whn pressed pops up a dialog box. This works fine, but when I close the dialog box one of my panels in the frame will not work properly. i.e. one of the
-
Three month macbook crashes often
this is what i get Anonymous UUID: 95A38431-A15D-AC32-0BCB-A59C1872FF20 Tue Sep 2 12:04:48 2014 panic(cpu 2 caller 0xffffff80176dc24e): Kernel trap at 0xffffff80176a3699, type 13=general protection, registers: CR0: 0x0000000080010033, CR2: 0x0
-
Silver software asset management competency
Can someone please confirm that I have understood correctly these things? Company X wants to get Silver software asset management competency, to do that first step is: Your company must employ or contract with two Microsoft Certified Professionals (M