Concat substring and string question
Hello,
So I am trying to add together a string \\fafs10\home and the concat of a substring of the first initial of a GivenName and LastName. I keep getting a NaN error.
Here's what I have:
=string("\\fafs10\home\") + concat(substring(GivenName,0,1), LastName)
I want to return this as a default value to my list.
Any help would be greatly appreciated. Thank you.
Matthew
Hi
are you doing this in a calculated column or within a rule on an InfoPath form or another way?
you should probably just go with
concat("\\fafs10\home\",substring(GivenName,0,1),LastName)
Regards
Sergio Giusti Sergio Blogs
Linked
In Profile
Whenever you see a reply you think is helpful, click Vote As Helpful.
Whenever you see a reply you think is the answer to the question, click Mark As Answer.
Similar Messages
-
Hello,
My requirement is that I need to concat a string with a date. I tried to convert the date to char but I am not getting the date format and then want to contact with the string.
here is the requirement:
Contact Date: 12/08/2011.
In order to do this, I tried to convert the date into string but having difficulty in getting the date format.
any help is appreciated.
Thanks -manyam16 wrote:
Hello,
My requirement is that I need to concat a string with a date. I tried to convert the date to char but I am not getting the date format and then want to contact with the string.
here is the requirement:
Contact Date: 12/08/2011.
In order to do this, I tried to convert the date into string but having difficulty in getting the date format.
any help is appreciated.
Thanks -The "tricky" part to what you are asking for is that when you cast a date column as char, the format may change. For example, when I look at my system date as is (it is a date field), the format is as follows:
1/26/2012 5:53:11 AM
When I cast it as CHAR, it appears as follows:
2012/01/26 05:53:11
Why am I saying this? Because the details of the next step will be determined by where the characters are in the string. For this exercise, I will assume that after casting to CHAR, the format is as you say. Then the stringing should look something like this:
Contact Date: 12/08/2011. SUBSTRING(CAST("your date column" AS CHAR) FROM 1 FOR 2) ...to give you the 12
SUBSTRING(CAST("your date column" AS CHAR) FROM 4 FOR 2) ...to give you the 08
SUBSTRING(CAST("your date column" AS CHAR) FROM 7 FOR 4) ...to give you the 2011
So concatenating them, you get:
SUBSTRING(CAST("your date column" AS CHAR) FROM 1FOR 2)||'/'||SUBSTRING(CAST("your date column" AS CHAR) FROM 4 FOR 2)||'/'||SUBSTRING(CAST("your date column" AS CHAR) FROM 7 FOR 4)
Now you can concatenate your text to the above string... -
How to Split the string using Substr and instr using loop condition
Hi every body,
I have below requirement.
I need to split the string and append with single quotes('') followed by , (comma) and reassign entire values into another variable. so that i can use it where clause of update statement
for example I am reciveing value as follows
ALN varchar2(2000):=(12ERE-3MT-4Y,4IT-5O-SD,OP-K5-456,P04-SFS9-098,90P-SSF-334,3434-KJ4-O28,AS3-SFS0-J33,989-3KL-3434);
Note: In the above variable i see 8 transactions, where as in real scenario i donot how many transaction i may recive.
after modification i need above transactions should in below format
ALTR Varchar2(2000):=('12ERE-3MT-4Y','4IT-5O-SD','OP-K5-456','P04-SFS9-098','90P-SSF-334','3434-KJ4-O28','AS3-SFS0-J33','989-3KL-3434');
kindly help how to use substr and instr in normal loop or for loop or while loop while modifying the above transactions.
Please help me to sort out this issue.
Many Thanks.
Edited by: user627525 on Dec 15, 2011 11:49 AMTry this - may not be the best way but...:
create or replace type myTableType as table of varchar2(255)
declare
v_array mytabletype;
v_new_str varchar2(4000);
function str2tbl
(p_str in varchar2,
p_delim in varchar2 default '.')
return myTableType
as
l_str long default p_str || p_delim;
l_n number;
l_data myTableType := myTabletype();
begin
loop
l_n := instr( l_str, p_delim );
exit when (nvl(l_n,0) = 0);
l_data.extend;
l_data( l_data.count ) := ltrim(rtrim(substr(l_str,1,l_n-1)));
l_str := substr( l_str, l_n+length(p_delim) );
end loop;
return l_data;
end;
begin
v_array := str2tbl ('12ERE-3MT-4Y,4IT-5O-SD,OP-K5-456,P04-SFS9-098,90P-SSF-334,3434-KJ4-O28,AS3-SFS0-J33,989-3KL-3434', ',');
FOR i IN 1 .. v_array.COUNT LOOP
v_new_str := v_new_str || ''''||v_array(i)||'''' || ',';
END LOOP;
dbms_output.put_line(RTRIM(v_new_str, ','));
end;
OUTPUT:
=======
'12ERE-3MT-4Y','4IT-5O-SD','OP-K5-456','P04-SFS9-098','90P-SSF-334','3434-KJ4-O28','AS3-SFS0-J33','989-3KL-3434'HTH
Edited by: user130038 on Dec 15, 2011 12:11 PM -
Hello all,
Pretty simple question, just running into syntax errors.
I want to take the first letter of fields 1 and 2, and the 6, 9, and 3rd number of fields three. I can do this with a substring one at a time, but I need to this so it puts all of the values from the substr together, ex. 051097HT. This is Date of birth, and initials. How would I usr the Concat for this. My last attempt.
TextField1.rawValue = Concat(Substr (txtDOB.rawValue, 6,2),(Substr(txtDOB.rawValue,9,2)
This is not the complete solution, just 2 parts. Not sure how to write it to put it together.
TIA!!!
RudyJim,
These string operations are part of Core JavaScript, not Acrobat. To learn about using string in the JavaScript language you should take a look at a JavaScript Language Reference. The O'Reilly book is the best but there are plenty of online resources as well.
>>TextField1.rawValue = str1.substr, (6,2)+ str2.substr, (9,2)
This line has a syntax problem, it should be
TextField1.rawValue = str1.substr(6,2)+ str2.substr(9,2);
To keep it from adding the numbers you can force the this expression into a string context like this
TextField1.rawValue = String(str1.substr(6,2))+ String(str2.substr(9,2));
OR
TextField1.rawValue = str1.substr(6,2).concat(str2.substr(9,2));
Thom Parker
WindJack Solutions
www.windjack.com -
I have a non-validating sax-parser, which appears to work fine. Except in some instances it hiccups and loses characters. "How are you" will come out as "are you".
I found the problem occurs in the method that reads chars and creates a substring.
When start reaches 8192, it resets itself to 1 and starts a new line, thereby chopping the text.
How can I reset start?
Jim
public void characters (char ch[], int start, int length)
// add the question text to the array
if(question_text)
String question = new String(ch).substring(start,start + length);
question = question.replace('|', '&');
XMLQuestionText[XMLquestion_text_counter] = question;
System.out.println("Q " + question );
// add the choices
else if( choice_text )
choice = new String(ch).substring(start,start + length);
choice = choice.replace('|', '&');
XMLChoices[XMLquestion_text_counter][choice_counter] = choice;
System.out.println("Choices " + choice );
for (int i = start; i < start + length; i++) {
switch (ch) {
case '|':
ch[i] = '&';
break;
case ' ':
//System.out.print("**");
break;
case '\n':
//System.out.print("\\n");
break;
case '\r':
//System.out.print("\\r");
break;
case '\t':
//System.out.print("\\t");
break;
default:
break;
}// switch(ch[i])
}// for
}// characters()Probably your characters() method is being called twice by the parser, once for the "How " part and again for the "are you" part, and probably the parser decides to do this because of its 8192-character internal buffers. Unfortunately this is legitimate behaviour for a SAX parser, and you'll have to fix your program to allow for it.
-
Hi!
I have two questions:
1) Can I do toString() on a null value?
2) Is there any difference in writing:
String s = new String();
and
String s;isnt it true that in the first case s -object of
String class is created??Yes, the empty string, length zero, as he said.
>
in second case just defining a variable type String??Yes. It will either be null or have an udefined value, depending on whether it's a member variable or a method variable. -
Find Substring in String in Workflow
I'm trying to separate the content from GUID with metadata, but I can't find the Find Substring in String function in SharePoint Designer 2013 mentioned on
MSDN. Can anyone provide guidance? Thanks!Its a not a function. It is workflow action under Actions menu in your SPD 2013.
You can find that action under the Utility Actions and make sure you have selected All Actions as show in the image above.
Amit -
Hello,
I have a string (column is normal range) like 70 - 110 mg/dl.
I wanted to separate 70 and 110.
For 70 i am using like this
select substr(normal_range,1,instr(normal_range,'-')-1) from m_parameters where normal_range='70-110 mg/dL'. It works.
But how to get 110.
Some rows may also be 110-209 U/L without any space between '-'.I want a query which works for all conditions.
Conditions are.
1. 70 - 110 mg/dL
2. 70-110mg/dL
3. 70 -110mg/dL
4. 70- 110mg/dL
5. 70-110 mg/dL
thanks
SwapnaHi Swapna,
Using the old-fashioned SUBSTR and INSTR combination:
SQL> with t
2 as
3 (
4 select '0.3 - 1.0 mg/dL' str from dual union all
5 select '70 - 110 mg/dL' str from dual union all
6 select '70-110mg/dL ' str from dual union all
7 select '70 -110mg/dL ' str from dual union all
8 select '70- 110mg/dL ' str from dual union all
9 select '70-110 mg/dL ' str from dual
10 )
11 select trim(substr(str, 1, instr(str, '-') - 1)) num1,
12 trim(substr(str, instr(str, '-') + 1, instr(str, 'mg') - instr(str, '-') - 1 )) num2
13 from t;
NUM1 NUM2
0.3 1.0
70 110
70 110
70 110
70 110
70 110
6 rows selected.
SQL>Asif Momen
http://momendba.blogspot.com -
Substring for Strings, what do I use for a int variable???
Hi!
substring for Strings...
String s1 = p.substring(1,2);
but what do I use for a int variable?
int i1 = integ."???????"(1,2);
/Henrikwhy, you use maths of course!!
or if you're not up to that, try this:
int x = 931;
String s = x+"";
String res = s.substring(1, 2);
and of course set it back to an int
with Integer.parseInt(res); -
Problem with Column types and String
Hi
I have some problem while comparing against empty string.
My column is of type it_Linked_Button. Actually it seems that column type doesn't matter.
If cell that belongs to this column is empty and based on other columns' values I put some value into this cell.
It works fine.
But when I clear that cell and try to put some value again nothing happens.
In my if statement I'm checking against empty string and it fails second time.
Before I put anything in that cell (in debugger) that value is "" so it is empty and it works.
(OK, I see that after I posted this message it was slightly reformated)
But after I put something and clear that cell and try to put something again (in debugger) I get "(here is some long space) " which fails String.IsNullOrEmpty(var) test.
What is going on? Has it something to do with Column type?
How to clear it so I can put something in it again?
One more thing - to put values and clear it I use DbDataSource SetValue method. And String.Empty or ""(doesn't matter)
Thanks
Kamil
NOTE
I made some workaround that gives me the behaviour I want but still I would like to know what is going on?
Edited by: Kamil Wydrzycki on Sep 24, 2009 12:57 PMDrLaszloJamf wrote:
warnerja wrote:
DrLaszloJamf wrote:
1. Could you define an Enum? Then you could switch on enum values.
2. Wait for Java 7 which is supposed to extend switch to strings?3. Put the target strings in a collection, write a loop to find the match in the collection and use the matching index in the switch statement. At least that will get rid of the hashcode kludge, where it won't mistakenly 'match' a string which isn't the actual target.3b: Map<String, Command>Yep.
I also wanted to point this out to the OP:
For example, let's say the 7 character string "BugABoo" happens to have the same hashcode as "EDI_DOC". And let's say your input just happens to have the string "BugABoo" in it, where you're extracting the 7 character substring. See the problem? You're getting "BugABoo" but treating it as if it really were "EDI_DOC", by virtue of comparing hashcodes instead of actual strings.
OOPS! -
JTextPane and preferredSize question
I have a textPane that will display different length stings with the click of a button, I want the the textPane to resize it's hieght according to the size of the string.
The first question the pane sizes it's height to 6 which doesn't show the text, from there on out it sizes fine(35, 60, and so on ). I'm stumped.
here's snippet of code
layeredPane.removeAll();
String question = questionText[currentQuestionNumber];
questionPane.setText(question);
q = questionPane.getPreferredSize();
layeredPane.add( questionPane, questionPaneLayer );
layeredPane.add( buttonPanel, buttonLayer );
questionPane.setBounds( 0,0,screenW,q.height );
buttonPanel.setBounds(0,q.height,screenW/6,screenH );
jPanel1.add(layeredPane, BorderLayout.CENTER);
validate();
repaint();JimI thought that when you added the text, the preferred size kicks in and sets it, but apperently I'm misunderstanding something here.
anyone? -
RE: Extracting OIM Password and Challenge Questions
Hi,
I am trying to look at the best way to extract OIM password and challenge questions from one system to another and wondered if any one could point me in the right direction. I am guessing that I need to use the UnauthenticatedSelfService API.
Regards,
Simon//Get Challenge Questions
Long l = moResultSet.getLongValue("Users.Key");
>>
challengeQues = moUserUtility.getChallengeValuesForUser(l);
if(challengeQues != null) {
String s[] = challengeQues.getColumnNames();
for (int k = 0; k < challengeQues.getTotalRowCount(); k++) {
challengeQues.goToRow(k);
String question = challengeQues.getStringValue("Users.Password Challenge Question.Question");
String answer = challengeQues.getStringValue("Users.Password Challenge Question.Answer"); -
Account with an icon of a face and a question mark
Same issue of other user in Yosemite Apple Support.
Following advises on that thread I also installed the ETRECHECK software tool, report is as follows:
Problem description:
At the login screen I find an icon with a face and a question mark in it - with a message it needs an update.
EtreCheck version: 2.1.5 (108)
Report generated 02 gennaio 2015 12:37:26 CET
Click the [Support] links for help with non-Apple products.
Click the [Details] links for more information about that line.
Click the [Adware] links for help removing adware.
Hardware Information: ℹ️
MacBook Pro (13-inch, Mid 2012) (Verified)
MacBook Pro - model: MacBookPro9,2
1 2.5 GHz Intel Core i5 CPU: 2-core
16 GB RAM Upgradeable
BANK 0/DIMM0
8 GB DDR3 1600 MHz ok
BANK 1/DIMM0
8 GB DDR3 1600 MHz ok
Bluetooth: Good - Handoff/Airdrop2 supported
Wireless: en1: 802.11 a/b/g/n
Video Information: ℹ️
Intel HD Graphics 4000
Color LCD 1280 x 800
System Software: ℹ️
OS X 10.10.1 (14B25) - Uptime: 1:22:54
Disk Information: ℹ️
APPLE HDD HTS545050A7E362 disk0 : (500,11 GB)
EFI (disk0s1) <not mounted> : 210 MB
Recovery HD (disk0s3) <not mounted> [Recovery]: 650 MB
Macintosh HD (disk1) / : 498.89 GB (467.03 GB free)
Encrypted AES-XTS Unlocked
Core Storage: disk0s2 499.25 GB Online
MATSHITADVD-R UJ-8A8
USB Information: ℹ️
Apple Inc. FaceTime HD Camera (Built-in)
Apple Computer, Inc. IR Receiver
Apple Inc. BRCM20702 Hub
Apple Inc. Bluetooth USB Host Controller
Apple Inc. Apple Internal Keyboard / Trackpad
Thunderbolt Information: ℹ️
Apple Inc. thunderbolt_bus
Gatekeeper: ℹ️
Mac App Store and identified developers
Launch Daemons: ℹ️
[loaded] com.adobe.fpsaud.plist [Support]
User Login Items: ℹ️
iTunesHelper Applicazione (/Applications/iTunes.app/Contents/MacOS/iTunesHelper.app)
Dropbox ApplicazioneHidden (/Applications/Dropbox.app)
Internet Plug-ins: ℹ️
FlashPlayer-10.6: Version: 16.0.0.235 - SDK 10.6 [Support]
Flash Player: Version: 16.0.0.235 - SDK 10.6 [Support]
QuickTime Plugin: Version: 7.7.3
Default Browser: Version: 600 - SDK 10.10
Safari Extensions: ℹ️
Pin It Button [Installed]
Save to Pocket [Installed]
Add To Amazon Wish List [Installed]
3rd Party Preference Panes: ℹ️
Flash Player [Support]
Time Machine: ℹ️
Time Machine not configured!
Top Processes by CPU: ℹ️
14% WindowServer
3% hidd
2% Safari
1% Dock
0% fontd
Top Processes by Memory: ℹ️
333 MB com.apple.WebKit.WebContent
155 MB mds_stores
137 MB Safari
137 MB Finder
86 MB Dropbox
Virtual Memory Information: ℹ️
7.76 GB Free RAM
4.88 GB Active RAM
3.28 GB Inactive RAM
1.26 GB Wired RAM
4.73 GB Page-ins
0 B Page-outs
Diagnostics Information: ℹ️
Jan 2, 2015, 11:15:06 AM Self test - passed
Jan 2, 2015, 12:06:57 AM /Library/Logs/DiagnosticReports/Dropbox109_2015-01-02-000657_[redacted].cpu_res ource.diag [Details]
---------- is there any troubleshooting for delete that fake account every time I start my Macbook Pro?
thanks and regards
EdoardoSmiley face with a ? means a bootable system is not found.
There maybe a problem with either system software or hard drive itself.
Try this.
Repair Disk
Steps 2 through 8
http://support.apple.com/kb/PH5836
Best. -
How to Plot number and string in one row (data logger counter) ?
hi all i made data log quantity using Digital Counter via modbus to monitoring quantity and reject that has and Name Operator, Machine and Part Number.
i have problem about plot the number & string in one row, as shown on the picture below :
how to move that string on one row ? i attach my vi.
Thanks~
Attachments:
MODBUS LIB Counter.vi 39 KBDuplicate and answered - http://forums.ni.com/t5/LabVIEW/How-to-Plot-number-and-string-in-one-row-data-logger-counter-via/m-p...
-
Difference between String=""; and String =null
I want to know the difference especially the ADVANTAGE between the following-
1. String s="";
String s="ABC"
and
String s;
String s="ABC";
or String s=null;
String s="ABC";
2. Object anyObject;
anyObject-new Object();
and
Object anyObject=null;
anyObject=new Object();Tanvir007 wrote:
I want to know the difference especially the ADVANTAGE between the following-
1. String s="";s points to the empty string--the String object containing no characters.
String s="ABC"s points to the String object containing the characters "ABC"
String s; Declares String reference varialbe s. Doesn't not assign it any value. If it's a local variable, it won't have a value until you explicitly assign it. If it's a member variable, it will be given the value null when the enclosing object is created.
String s="ABC";Already covered above.
or String s=null;s does not point to any object.
String s="ABC";???
You've already asked this twice.
Are you talking about doing
String s = null;
String s = "ABC";right after each other?
You can't do that. You can only declare a variable once.
If you mean
String s = null;
s = "ABC";It just does what I described above, one after the other.
2. Object anyObject;
anyObject-new Object();
and
Object anyObject=null;
anyObject=new Object();As above: In the first case, its value is undefined until the new Object line if it's a local, or it's null if it's a member.
As for which is better, it depends what you're doing.
Maybe you are looking for
-
HT1212 my home button is broken and i dont have find my iphone.. what to do to restore
MY home button is broken and my ipod is disabled cuzz i forgot the password how to restore it?
-
Planned order number - MFBF - Backflush
Hi, Expert. In t-code MFBF in th field "planned order number" where and how I can put in this field as mandatory. I appreciate any help on this subject and also a step by step to implement, if possible Best Regards Armando
-
How do i restore my events to my iphoto from backup
i need help
-
TS3988 The maximum number of free accounts have already been created on this iPad
My iCloud error message when I try to sign in, the maximum number of free accounts have already been activated on this iPad. Someone please tell me what I can do to solve this problem, I would really like to back up my iPad in case anything was to ha
-
HTMLDB updateable report not showing the updated values after pagination
Create updateable multiple record report usingselect wwv_flow_item.display_and_save(1,xxxx) a,wwv_flow_item.display_and_save(2,yyyy) b, htmldb_item.select_list(3,STATUS,'Not Applicable; Not Applicable,Pending;Pending,Closed;Closed') Status, htmldb_it