Manipulating Complex Strings

Im wondering if anyone can help me with this, its driving me nuts now...
i have an array with the following type of data:
test=%VARNAME%.domain.com
application=%APPNAME%
username=%USERID%.domain.com
i would like to read in each line and copy it to another array list.
What i would like to happen is when it gets to a point in the line where there are %TEXT% it turned it into a token of somesort and replaces it with a variable i have define. eg i have defined in my code VARNAME, so i would like my code to read in
test=%VARNAME%.domain.com
and then return
test=HereIsMyValue.domain.com
i know its alot to ask but even if someone could point me in the right direction i would be greatful . . . im getting myself stuck in a bit of a while loop at the moment trying to figure out the best way to approach this.
Incase your wondering what its for, im making an application that creates custom ica files to call up applications off citrix server.Kindest Regards! Mario

Your best bet would be to create a Map<String, String> that maps tokens to the values they represent. Then, you can just iterate through your tokens ans use one of the String.replaceXXX() methods to replace each of the tokens with their respective values.

Similar Messages

  • Complex string pattern match/sort question for mapping data - Exchange Enable mailbox use case

    Hi,  Im trying to do a runbook to Enable mailbox for a user.  Our Exchange Admin uses a rule/formula to allocate the mailbox database based on users first name and this is what I am having difficulty replicating in Orchestrator to add the correct
    data in the Database property of Enable Mailbox activity.
    The Rule exchange uses, takes up to the first 3 chars of forename and based on an alphabetic sort, it will allocate to a particular mailbox db (we have a quite large Exchange Org with 20k users so hes tried to allocate about 500 users per mailboxDB).  so
    for example User Forename A-ALI = DB1, ALL-ANG = DB2, ANH-ANY=DB3,AO-BER=DB4 etc etc.
    So I was hoping someone could advise of some string comparison activities native in Orchestrator or maybe done as last resort in powershell (as I'm not great in powershell) to provide a map of the published data for forname to appropriate mailbox matrix.
    Any help on this would be much appreciated...
    Cheers

    You could use the built in Mid function [Mid(‘Return subset from this string’,1,3)] to get the first three letters of their name and honestly I would send
    this to the Run .Net Script activity using powershell myself and do a select case to get it to publish to the database the name of the database server.
    I am all for using  built in activities to do things in Orchestrator but you are going to quickly find that you need to have good powershell scripting skills to extend the tools beyond the capabilities of the built in activities.
    Vaughn

  • Complex string value

    Hello,
    I need to send a command to a piece of equipment where the command is in the form of a string. The command is something like this:
    VBS 'app.Acquisition.Trigger.Serial.I2C.AddressValue="​00111110"'
    Notice the double quotes around the value and single quotes around most of the command. Now when I setup my string, the whole thing is actually within double quotes so the actual string is:
    "VBS 'app.Acquisition.Trigger.Serial.I2C.AddressValue="​00111110"'"
    TestStand has a problem with this since it thinks the end of the string is at the double quotes before the first "0". Any ideas how to deal with this?

    Never mind, I figured it out. If anyone is interested this is to control a Lecroy scope. The had to modify the command to:
     "VBS 'app.Acquisition.Trigger.Serial.I2C.AddressValue=\​"00111110\"'"

  • How do we compare a complex string?

    Hi guys,
    how do i compare the following strings
    input_Variable: User-agent : *
    if i want to ensure that the input_variable has "User-agent" and the character '*'.
    There are 3 possiblities for input_variable:
    1) User-agent: *
    2) disallow: http:///xxxxxxxxxxxx
    3) User-agent:Somename
    The white space between the words could be uneven and same goes with the character case.
    thanks,
    Derik

    Hi.. Derik
    How about this one..
    String input_Variable = "[from your input method]";
    if ( input_Variable.indexOf("User-agent") != -1
    && input_Variable.indexOf("*") != -1 )
    System.out.println("yeah.. authorized..");
    indexOf(String str) method returns -1 when it can't find out a specific string from the source string..

  • Manipulation with String - EBCIDIC

    Hello,
    I need to manipulate a String.
    I have to change each letter within the String, but the conversion table I need to use is EBCIDIC.
    For example :
    I have to change a letter's value 64 in EBCIDIC to A3 in EBCIDIC , etc... (just like in ASCII, which I know how to do, but in EBCIDIC).
    How should I do that Please ?
    Thanks !!

    user10271300 wrote:
    Hello,
    I need to manipulate a String.
    I have to change each letter within the String, but the conversion table I need to use is EBCIDIC.I suspect not. Since Java String objects are always always always UNICODE encoded as UTF-16 one cannot convert a String to EBCDIC. I suspect what you actually need to do is convert the String content to bytes using EBCDIC. Something like byte[] ebcdicEncoded = "some string".getBytes("Cp500") . See http://docs.oracle.com/javase/1.4.2/docs/guide/intl/encoding.doc.html for possible encodings.
    >
    For example :
    I have to change a letter's value 64 in EBCIDIC to A3 in EBCIDIC , etc... (just like in ASCII, which I know how to do, but in EBCIDIC).
    How should I do that Please ?
    Thanks !!

  • Manipulating Substitution String

    Hi,
    Is there any way to assign or change value, of the substitution string?
    And also how can i accomplish theme switching on the fly?
    Please Help.
    With Regards,
    Krishna Vashistha | Eon Technologies
    Sr. Programmer

    Hi Krishna
    A Substitution String in APEX is a constant. Try replacing the Substitution String with an Application Item (this is found in the "Shared Components - Logic" area).
    I'm not sure about switching themes on the fly. Anyone else know about this?
    Cheers,
    Patrick

  • Manipulating a string based on an "_" Delimeter

    My data column looks like this...
    AAA_BBB_CC_DD
    I need it to come out as...
    CC_BBB_DD
    Is there any easy way to do this in Oracle using the "_"(underscore) as a Delimeter???
    The BBB portion of the Data has different lengths which is why I can't really do it with a SUBSTR.
    Any suggestions???
    Thanks in advance for your review and am hopeful for a reply.
    PSULionRP

    Subquery factors can help to beautify (perhaps de-uglify might be more accurate:))...SQL> WITH dat AS (
      2  SELECT 'AAA_BBB_CC_DD' str FROM DUAL
      3   UNION
      4   SELECT 'W_X_Y_Z' FROM DUAL
      5  ), ins AS (
      6  SELECT  str,
      7          Instr (str, '_', 1, 1) d1,
      8          Instr (str, '_', 1, 2) d2,
      9          Instr (str, '_', 1, 3) d3
    10    FROM dat
    11  )
    12  SELECT  str, Substr (str, d2+1, d3-d2) ||
    13          Substr (str, d1+1, d2-d1) ||
    14          Substr (str, d3+1) newstr
    15  FROM ins
    16  /
    STR           NEWSTR
    AAA_BBB_CC_DD CC_BBB_DD
    W_X_Y_Z       Y_X_Z

  • String manipulation in JSTL

    Hello All
    I'm a just a beginner and I'm need to write a web page that is totally based on JSTL. I found out that the standard java tab lib in JSTL doesnt really support string manipulation or regular expression like in perl.
    As such, I would like to know what are the different options (like adding servlets/javabeans/etc) can i add to my JSTL page so that i can perform complex string manipulation to a data entered by the user in the text box?
    Some of the operations that I wish to carry out on the data are:
    1. check if data contains certain characters, strings
    2. joining and spliting strings
    3. find length of the string
    4. find the position of certain character in a string
    5. check if string match certain pattern.
    and many more.
    Would greatly appreciate if you guys can help to provide some light.
    Regards
    Beginner....

    You might find MicroNova YUZU JSP tag library (http://sourceforge.net/projects/micronova-yuzu) useful, especially if you need to support both JSP 1.2 and 2.0. Hope this helps.

  • Parse String in OBIEE Answers.

    Please can someone help me to know how to parse a string in obiee answers:
    Eg: 'Administrators;XMLP_ADMIN;319'.
    I can do this very easy in Java but not sure how to do it in OBIEE. Appreciate your help
    Regards.

    Hi,
    what are you expecting to do with that string? can you be more specific?
    you want to have all values before the semi colon?
    you can use regexp in obiee to parse these kind of strings..
    i think this must be helpful to you..
    http://oraclebizint.wordpress.com/2009/06/04/oracle-bi-ee-10-1-3-4-1-handling-complex-string-manipulations-using-regular-expressions-regex-and-evaluate/
    if its helpful award points
    thanks,
    karthick
    Edited by: kart on May 28, 2010 3:56 PM

  • Essbase 9.3 Calc scripts. Pb with dates. How to convert (string = number) ?

    Hello,
    I've a problem with Essbase(Planning?) Scripts on version 9.3. It looks simple but I do not find any (clean) solution :
    On my Essbase database, I have a member called "Reference_Date" on my axis Indicators. It is a date data type, that is to say, it displays a number corresponding to a YYYYMMDD format. For example : 20091029 for October 29th 2009.
    In calc scripts I often need to compare the month included in that "Reference_Date" with the current Member of my Time Axis (I have 12 Months members based on the format M02 for February for example). The final aim is to calculate a number of complete years since that "Reference_Date".
    But theses two elements are not of the same "type" (one is a number value and the other is a "member" in Time Axis). So I'm forced to convert one of this two elements in order to compare it.
    For example I can extract the month value of the "Reference_Date"' and put an "M" before it to have a Time member equivalent or I can convert the member Name M10 to a number (10))
    in both cases I have the same type problem : I don't know how to convert a string into a number nor how to convert a number into a string.
    (For example @CONCATENATE doesn't work with numbers). and that my only remaining problem.
    I didn't find any Essbase Function which do this (conversion number <=>string).
    Is anyone have an Idea ?
    Thanks for your help
    Best regards

    I don't know any way for you to compare your data against your metadata. Not directly. To me it makes little enough sense to try that I'm not surprised the developers didn't provide for it.
    I've converted member names to strings, manipulated the strings (calc script functions are not good at this), and turned them back into member names, but that's really the only use I've had for string manipulation. I don't think an equivalency operator even exists for string data. And I see no way to begin thinking of a member name, once converted to a string, as a number.
    It makes even less sense to me to try thinking of a data value as a string. Even text values in Sys 11 are stored as numbers. Not encoded characters, but just a number to look up somewhere.
    I think you can do what you want though, with something like this...
    IF (@ISMBR("FY08"))
    vYr = 2008;
    ELSEIF (@ISMBR("FY09"))
    vYr = 2009;
    ENDIF;
    IF (@ISMBR("M01"))
    vMth = 1;
    ELSEIF (@ISMBR("M02"))
    vMth = = 2;
    ENDIF;
    "Years_Since_Reference" = ((vYr * 100) + Mth) - ("Reference_Date" / 12);
    Obviously, the math will need some work, coz that doesn't actually work, but the logic above essentially turns your metadata into numbers, which is what you are after.
    Good luck,
    -- Joe

  • Why only +String concatation for Operator Overloading ?

    Java does not support operator overloading other than the + operator for addition of two Strings or a number and a String.Why only the + operator and Strings, even when we have a concat() for addition of Strings ?
    Wondering if anyone could provide me some link as to why this only this (+) operator was chosen.
    Thank you for your consideration.
    Edited by: amtidumpti on Apr 27, 2009 6:40 AM
    Edited by: amtidumpti on Apr 27, 2009 6:40 AM

    amtidumpti wrote:
    stevejluke wrote:
    amtidumpti wrote:
    Java does not support operator overloading other than the + operator for addition of two Strings or a number and a String.Why only the + operator and Strings, even when we have a concat() for addition of Strings ? I assume the + was implemented (even with the concat() method present) for simplicity with working with Strings. Why only +? What other operators make sense as String manipulation operators? Why are they useful?We already have String,StringBuilder,StringBuffer for simplicity and manipulations of Strings or may be they were added later,but even then we have this +.Right, and you can use those methods instead of +. But String is a much-used class, has several special attributes given to it, and the + is very self-explanatory when applied to Strings.
    Also would == qualify as the other operator for operator overloading in java ?== has no special meaning for Strings (or really for Objects at all). It has exactly one purpose, to compare the value of the operands provided. When the operands are primitives, it compares their values exactly as you or I would (if the primitive values are equal you get true). When the operands are reference types the value of the references are tested for equality (if they don't hold a reference to the same Object, then == returns false).
    >
    int iAge1=0,iAge2=0;
    String sName1="Java",sName2="Rocks";
    double dMark1=89.02,dMark2=92.0;
    if(iAge1==iAge2)
    System.out.println("HURRAH");
    if(sName1==sName2)
    System.out.println("HURRAH");
    if(dMark1==dMark2)
    System.out.println("HURRAH");Also in case of boolean :
    boolean bFlag1=false,bFlag2=true;
    if(bFlag1=bFlag2)
    System.out.println("Value Assignment done");Here is " = " working not only as a assignment operator as well as conditional operator ?
    Thanks for your consideration.

  • Processing power for !Format Event

    I'm planning to do some slightly complex string manipulation to an Adobe Output Designer template field using the !Format event, like such:
    @(If ((@(Length ("@_$_.")==9))&&@(Substr ("@_$_.", 1, 1)=="A"),"@(Substr ("@_$_.", 1, 1))****@(Substr ("@_$_.", 6, 4))", "@_$_."))
    There is some concern by my server admin about the server load for this string manipulation, especially if the Adobe Output Designer is generating hundreds of thousands of documents.
    Has anyone encountered any slowdown in the system as a result of the !Format event string manipulation? Is it known to be inefficient in any way? Sorry for the odd question and thanks in advance for the advice.

    Hi,
    I don't know enough about balanced vs unbalanced issues to comment but I will tell you that I'm only running with 2 GB ram (1 + 1), running lots of plugins and software instruments and I am not encountering these problems. Since I've never heard of anyone having problems with odd numbered or unbalanced ram, I'm wondering if there may be faulty ram at play here. From the way Dreams described his/her current project I can't see this maxing out 2 Gb ram let alone 3. But if the system was only addressing 1 Gb ram... Maybe. The only other thing I can suggest is making sure your not leaving other unnessessary apps running in the background. Could just be another bug. By the way I don't know whether or not you know this but clicking on the little CPU meter on the transport bar brings up a much bigger meter.

  • Pls help 4m swing class

    Design, implement and test a Java class that will extract the required information from a headstone inscription. From a programming viewpoint this involves complex string manipulation with a little file handling to get the inscription from the Text file. For each inscription it is required to display on the computer screen, in tabular form, the Name, Death Date and Birth Date of each person buried under the stone.
    Note:
    That the birth date is not always given. Often the age at death in years is given hence it would be possible to compute the birth year or the year after the birth year. Complications arise with the death of young children. Often the age at death is given in days or months hence it might be possible to compute an exact birth date or at least a birth month. As each inscription is analysed the �original� inscription should be displayed, thus giving an immediate visual check that the data has been extracted correctly.
    EX
    Some sample data from gravesite Stoke Oats Esfield, UK
    In / memory of / WENDY-SARAH / SMITH 6th of March 1599/ and HENRY TODOR 28th of
    January 1547/ Forever in our thoughts / love LIZ and HARRY /
    In loving memory / of / JACK McDONALD /aged 3 days / 1799 / Jesus said suffer little /
    children to come unto Me /
    In / loving / memory of / BARRY H / BEAX-SMITH / 1798 � 1882 / PAT C / BEAX-SMITH /
    1800 � 1896 /
    / In loving memory / of / SAUL SAM NOCKLEY / late of Shire hall / died Dec 19th 1801,
    aged 71 years / also GERT NOCKLEY / wife of the above / died Oct 22nd 1811, aged 79
    years / peace perfect peace /
    Treasured memories of / a loving husband, dad and grandad / JIM WEST / who died 8th March
    1780 / aged 80 years / Joined by / a devoted wife, Mum and Nan / JUNE / who died 4th
    November 1890 / aged 92 years /
    In loving memory / of my dear husband / GEORGE WILLIAM HERN / born July 30th 1802 /
    died August 31st 1872 /
    In loving memory of our father WILLIAM JOHN AVALEZ died 2nd March 1904 aged 60
    years /And our mother APRIL AVALEZ died 2nd May 1912 aged 74 years /
    In loving memory of JOHN CLEMENT died 9th April 1720 aged 14 years /Also of HENRY
    CLEMENT died 26th March 1748 aged 45 years /
    Pray for the repose of the soul of / JAMES BACON / who died 1st February 1892 / aged 24
    years / also of Sergeant BILL BACON / killed in action / 26th September 1898 aged 24 years /
    on whose souls sweet Jesus have mercy / R.I.P / Erected by their sorrowing parents / B and J
    BACON
    Treasured / memories of / JAMES / SNOW / born 22.8.91 / died 23.8.92 / Sleep tight my /
    precious /
    Loving memories / of / ANNE / MURRAY / 11.5.70 / to / 19.4.71 / Sleeping /

    Rarely a post of this type is met with much help at all: it falls into the category of "Here is my home work do it for me." It may not be your intent for that to occur, but when you just post the assignment the readers of the forum have little else to conclude, other than, you are asking for a free grade.
    If you post your attempts along with specific questions on where you are having problems, then almost everyone will be willing to help you along the way, but a "do it for me" type of post is just not going to be met with positive results.

  • CDF @JgetString help

    When I try and validate my custom defined function in my calc, i get error:
    Error: 1200324 Error compiling formula for [Depr Flag] (line 24): operator expected after [@JgetString]
    Calc:
    Var Yrs;
    Var YrsPl;
    Fix (Working, No_Location, Current_Forecast,FY09:FY31,"Annual Input")
    "Depr Flag" (
    Yrs="Start Year"->"No Year";
    YrsPl=Yrs - 2000 + 1;
    "Depr Flag"="Depr Flag"->@Member(@Concatenate("FY", @JgetString(YrsPl))) = 1;
    Endfix

    Mehmet, et al,
    I may have miss typed it in another post, but the function is JgetStringFromDouble
    If you guys are having difficulty finding a CDF to do something specific (they can do anything you can think of) please contact me through my blog: http://codingwithhyperion.blogspot.com/ I'm happy to develop something simple or guide you in creating something more complex.
    Regards,
    Robb Salzmann
    Here is the list of basic CDFs available for download from Oracle, written by the original CDF Cowboys; Matt, Mike, and Toufic
    Available at https://codesamples.samplecode.oracle.com/servlets/tracking/action/ExecuteQuery?query=essbase1
    >
    Author Name     Mike Larimer, Toufic Wakim, Matt Milella
    Title     CDF - String Functions
    Sample Type     example code
    Code Sample Version     n/a
    What it does     using Essbase Custom Defined Functions this sample allows for more complex string manipulation that is available in the Essbase calculator.
    Functions Include:
    @JconcatStrings - concatenates an array of strings.
    @JconcatStringDouble - concatenates a string to a double with control over the order.
    @Jequals - compares two strings case sensitive.
    @JequalsIgnoreCase - compares two strings case insensitive.
    @JcompareStringToDouble - compares a string to a double.
    @JLCase - returns lower case.
    @JUCase - returns upper case.
    @JgetStringFromDouble - returns a string.
    @JgetDoubleFromString - converts a string to a double.
    @JechoBoth - Echoes back all arguments passed to the function. To pass an array of arguments use @List(comma delimited list).
    @JechoString - Echoes back all arguments passed to the function. To pass an array of arguments use @List(comma delimited list).
    @JechoDouble - Echoes back all arguments passed to the function. To pass an array of arguments use @List(comma delimited list).
    @JgetDoubleQuote - Returns a string enclosed in double quotes.

  • Has anyone created a Visio-like VI app?

    I'm interested in creating a Visio-like app, where I can pick from a predefined set of objects (square, circle, etc.) and place them on a palette (Picture control).  I'd like to be able to use the mouse to select placed objects, either to move them, or to right click on them to look at / modify their properties.
    Has anyone done something like this?  I've created an app like this, but without any mouse interaction on the palette.  The user positions and resizes the object through a cluster control.  It works nicely, but using a mouse would be more natural.  And more user-friendly, especially for those not used to LabView.
    Bonus features that I'd like, but can't imagine that are feasible:  to use resizing boxes (e.g. at the corners of a square, to resize the square), and a ghost outline of the object when dragging it accross the pane or resizing it.
    I've played a bit with incorporating the mouse -- looking up which object is selected, drawing the ghost outline, adding the resizing boxes.  But it seems that I'm trying to make LabView do something that the OS is probably better suited to do....?
    The end goal is to be able to create a Visio-like screen made up of mostly-but-not-completely graphical objects and save its description in a proprietary format.
    I've got LV8, though I'm more familiar with LV7.1.  And I've been a proud user since LV3.0.  If this can be done, I think I can do it. ...   Help?
    Thanks!
    Tom

    "tst" <[email protected]> wrote in message news:[email protected]...
    <a href="mailto:Wiebe@CARYA" target="_blank">Wiebe@CARYA</a> wrote: Draw all the unique ID's as color values in a offscreen buffer (picture control)Use an event to get the mouse down.Lookup the pixel color in the offscreen bufferConvert it to object ID.
    That was my method until someone posted the VI shown in the attachment (I cleaned it up a little, documented it and added an example).
    If you have a series of points for your shape, then this should be a better method.
    That *is* a nice VI.
    But it's not better if you have a lot of objects. The InROI has to be called for each object, so the search time will grow with the number of objects. The offscreen buffer only doesn't have this problem. The InROI method will also be hard to use with lines. And with larger circles you have to use a lot of points, or you'll get incorrect hits or misses.
    One benefit is that you are still able to select objects even if they are totally covered by other objects. Guess a requirement specification is needed to make a choise. Switching from one to the other method will be terrible.
    Also, the picture control is just a string. If you dig into this string, you'll notice that you can make a buffer. In this buffer you can replace one single picture object. So you don't have to redraw all the entire picture. This way you can get a real performance boost. It's convenient to store object info in the same buffer.
    It would seem to me that it would be better to have a buffer of the picture itself (the blue wire) which will depend on the z ordering (i.e. everything "under" the currently selected element will be the base picture and all the other stuff would be redrawn). I haven't done any real examining of the picture control VIs, but I would rather avoid manipulating the string myself if only for the reason that NI might (please?) change the implementation to something more efficient.
    Well, the picture (blue wire) is a string with the length of the string as the first 2 bytes (perhaps 4, I'm not sure). So you can store each object's picture, and replace them one by one whenever you need to. Then, if you need the picture, remove all the sizes, concatenate the string, and put the total size before the string (then cast to picture).
    Or you can remove the size, and store the string, then concatenate, etc. and attach the total size.
    If NI changes the way it works, you only need to remake the "remove size.vi" and "concatenate.vi" (provided that concatenation is possible).
    The principle of the picture control is a virtual machine. The virtual machine itself is not that slow (unless you compare the 3d stuff to serious 3d stuff). It is slow because the subvi's that build the string are slow. Even worse, you need to call them each time anything in the picture changes. It is also slow because each time you draw anything, the pen is set (even if it hasn't changed).
    With the buffer you get a trade off. It will require more memory, but it can be much faster depending on the situation.
    With the standard picture control vi's, you are forced to build slow programs...
    Draw the ghost outline in a separate picture control. Make this picture control transparent, and set it to the same size and position as the "real" drawing. Don't forget to use the events of the top level picture control! This way, you don't have to redraw the entire picture when you move only one object.
    That's an interesting suggestion.
    Tom, if you do create something, it would be nice if you post it. Maybe we can improve it and make it into a general template.
    InROI.vi:
    http://forums.ni.com/attachments/ni/170/194933/1/InROI.vi
    ROI test.vi:
    http://forums.ni.com/attachments/ni/170/194933/2/ROI test.vi

Maybe you are looking for

  • Error when run page with EJB + ADF

    hello when i run one page with EJB+ ADF give me this error: <15/Set/2009 17H35m WEST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1253032513131' for task '0'. Error is: 'weblogic.application.Modul

  • Modify database table from internal table

    Hi All, I need to update database table from internal table which is having around 30000 records. I am using MODIFY tabname FROM TABLE int_tabname... Using this statement, I can modify the databse records very well. But user has some additional requi

  • A to Z instructions on using networked drive for TM

    I've spent a great deal of time over the course of the last three days trying to get TM working on three laptops backing up to an external HD connected via FW to a Mac Mini. At various times I'm getting "volume can't be mounted", "image can't be moun

  • Adobe media player does not have content after install.

    I just got into school for web development and they sent the cs5 master suite, adobe media player came with it. After installing it and logging in, I went to the adobe tv site and seen a slew of tutorials that I would love to use with adobe media pla

  • Time mgmt Doubt: How to stop quota update

    hello experts, we are facing a problem in stopping quota. thr requirment is like :   the entitlement is 2.5 days permonth, which is happening, the maximum accumulation is suppoesd to be 53 days, which is not happening. we are generating it every mont