Find a specific character in an input string and getting the string after if

Hello,
my requirement is as such, lets say we have an input string ABHISHEK #1234, or BOMBAY 123 #235,
i need to find if the character string has # in it,, if yes pick all the numbers after # .
in the above example, i need output as 1234 and 235
and if any non numeric values after # set a flag
please help me in this.
regards
Abhishek

Hi Abhishek,
This can be done in BODS using below settings in file format (only if your source is flat file):
Below is the source file data :
abcd#1234,Bombay#23456
By using this file format setting, you should be able to get all the numbers in one column which you can use futher and you can verify this columns data by using "is_valid_int", not null function in BODS.
I think it should give you solution.
Thanks,
Tanvi

Similar Messages

  • Converting a file to string and then, the string to a file

    I need to send a File (a JPG file) as String (inside a XML document).
    After this, i want to write the String representing the file (reading the XML document) as a File on my disk (making a JPG).
    Can anybody help me ???
    Thanks in advance !!

    I found this in the forum, the author was brianlmartino1
    and it works perfectly.
    Thank you !!
    import java.io.*;
    import org.apache.soap.encoding.soapenc.Base64;
    public class FileUtils {
    static public void main(String args[]) throws Exception {
    System.out.println("-- go !!!!");
    // get input binary source
    File file = new File("c:\\temp\\file.JPG");
    BufferedInputStream bis = new BufferedInputStream(new
    FileInputStream(file));
    int bytes = (int) file.length();
    byte[] buffer = new byte[bytes];
    int readBytes = bis.read(buffer);
    bis.close();
    // encode binary source
    String encodedString = Base64.encode(buffer);
    // decode String source and save the file to the disk
    byte[] buffer2=Base64.decode(encodedString);
    File file2 = new File("c:\\temp\\fileNew.jpg");
    BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file2));
    bos.write(buffer2);
    bos.close();
    System.out.println("-- ready !!!!");
    }

  • Isolating capitals in Strings, and altering the strings.

    Dear CodeWizards,
    My friend asked me to help him write some code for his website he's making. I'm a freshman in college, in elementary Java Programming, so I thought I could do it. Turns out I'm wrong, we haven't even touched on the stuff he wants me to do, and I would like your help if you could lend me a hand.
    Here's what he emailed me:
    "Hey Jason,
    You're in that computer programming class, right? Well I am making this website, and it has some little games on it and stuff. Part of it I don't know how to figure out. I want the person to input a name of an organization. Then I want the program to take all the capital letters, and put asterisks around them, then re print what he person says with the asterisks in there, as well as with the rest of the letters capitalized. Then I want it to print out just the capital letters in the asterisks, like an acronym. Also if there is anything in Parenthesis, i want it disregarded. Heres an example:
    What is the name? Midgets Riding UniCycles (How Fast Can They Go?)
    The name is: *M*IDGETS *R*IDING *U*NI*C*YCLES
    The Acronym is: MRUC
    Thanks,
    Jim"
    Anyway fellas, I'm in over my head here. I was told by an upperclassman this should be easy, but what upperclassman is going to help out a freshman, lol. If someone has a spare moment and they could whip this up, then I would appreciate it. If not, any help would be great. I am without direction. Sorry for being such a newb... Thanks again guys'n'gals.
    Jason

    What have you managed to do so far?
    Here's some general advice:
    Read the assignment text well, send email to your instructor about the parts
    that are not clear, and start doing it. Only when you encounter a problem that
    you can't overcome by reading your notes, the Java tutorial, or the
    documentation of standard classes come back here and ask a specific question
    with a clear description of the problem you are having with some source code,
    what you want it do, what it is doing instead, and possible error message.
    Java tutorial: http://java.sun.com/docs/books/tutorial/
    Documentation of standard classes: http://java.sun.com/j2se/1.5.0/docs/api/
    Examples of how to use them: http://javaalmanac.com

  • I can no longer hold down a key and get the character to repeat as say, aaaaa. Instead I get a menu of accented a's, such as àáâäæãåā. I can't find any thing in the System Preferences that allows my to turn this function off

    I can no longer hold down a key and get the character to repeat as say, aaaaa. Instead I get a menu of accented a's, such as àáâäæãåā. I can't find any thing in the System Preferences that allows my to turn this function off.

    Back up all data before proceeding.
    Please triple-click anywhere in the line below on this page to select it:
    defaults write -g ApplePressAndHoldEnabled NO
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window by pressing the key combination command-V. I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    Wait for a new line ending in a dollar sign ($) to appear below what you entered. You can then quit Terminal. Log out or restart the computer.

  • How to get the string's byte length?

    I have some string,I want to get the string's byte length,how
    can do it?
    for example:
    <cfoutput>#len('hihi,这是测试')#</cfoutput>
    output is 9
    I want to get the byte length is 14, how can i get it?
    Thanks.

    >> Fair cop. I didn't realise that asc() returned the
    codepoint rather than the
    > actual character code.
    >
    > and what would be the difference?
    Oh, sorry, whatever the term is (I'm crap with jargon). The
    value returned
    by asc() for those chars was only two bytes (ie: four hex
    digits). I
    didn't realise there was more to it than that, and that
    2-byte value maps
    to some other THREE byte value. I need to do some reading...
    > that's what both cf & java counted as the length.
    CHARACTER length, sure. No-one's disputing that. On the other
    hand,
    no-one's asking about it, either.
    > by adding a BOM you've already effected the encoding,
    which may or may not
    > match the original. so you still don't know how many
    bytes were in the original
    > string.
    [groan]
    Yes, that's a reasonable strawman there. I was only putting
    it in a file
    so I could save it and check the number of bytes occupied by
    the data.
    Clearly... CLEARLY... the OP is not asking for a character
    length of that
    string. They've said as much.
    I copy and pasted the string from their post, and used it as
    a
    demonstration of how "nine" is not the right answer for the
    BYTE LENGTH of
    that string. Whether or not the original string was UTF-8,
    UTF-16 or
    special-marmoset-encoding, it almost certainly was NOT in a
    fictitious kind
    encoding in which each of those particular characters only
    occupied one
    byte each, which would mean that "nine" is the correct answer
    to the
    question.
    When I copied those characters from either the web browser
    for from my
    text-based news agent, notepad identified them (and rendered
    them
    correctly) as UTF-8, so I'm fairly confident they ARE UTF-8.
    Of course
    this could be down to some intermediary encoding (pasting
    them in to the
    original posting, for example, via some encoding-transforming
    mechanism),
    but Occam's Razor suggests the original question was from a
    UTF-8 POV.
    But maybe we should quit speculating and ask the OP. Unless
    they've
    buggered off in despair of how drawn out all this is getting.
    For which I
    would not blame them.
    Adam

  • Differnce between null string and an empty string??

    what is the major difference between null string and an empty string??
    I wrote the following simple program and I could see some different output.
    Other than that, any other differences that we should pay attention to???
    C:\>java TestCode
    Hello
    nullHello
    public class TestCode
         public static void main(String[] s)
         {     String s1 = "";
              String s2 = null;
              System.out.println(s1 + "Hello");
              System.out.println(s2 + "Hello");
    }

    There's a big difference between the two. A null String isn't pointing to an object, but an empty String is. For example, this is perfectly fine:
    public class TestCode
        public static void main(String[] args)
            String s = "";
            System.out.println(s.length());
    } It prints out 0 for the length of the String, just as it should. But this code will give you a NullPointerException:
    public class TestCode
        public static void main(String[] args)
            String s = null;
            System.out.println(s.length());
    } Since s isn't pointing to anything, you can't call its methods.

  • I bought a gift card, but it hasn't shown up in my e-mail after 1 hour.  How can I find it and get the credit on my account?

    I bought an iTune gift card for myself and sent it to my e-mail address.  I have waited over an hour and the e-mail showing the gift card has not arrived.  How do I find it and get the credit put into my iTunes account so that I can buy some music?

    Oh hold on - sudden development!
    I panicked and force-shut down my computer because it froze after I clicked on the 'Reset Cache' option, then I logged back on and noticed the Cloud symbol next to the missing song. I clicked it, and it's finally downloaded properly! <3
    Mate, thank you so much for helping me out! xxx

  • PC went south. Geeks brought it back. PS elements and premier 11 can't start. Error msg sez configuration incorrect needs to be reinstalled. When I load the disk I get a blank screen. Try to uninstall and can't find apps i control panel. How can I get the

    PC went south. Geeks brought it back. PS elements and premier 11 can't start. Error msg sez configuration incorrect needs to be reinstalled. When I load the disk I get a blank screen. Try to uninstall and can't find apps i control panel. How can I get the apps back?

    adobeamatuer
    Thanks for the reply.
    Although the security of Windows XP SP3 32 bit is compromised by Microsoft no longer supporting XP, if Windows XP was restored as claimed, you should still be able to install/uninstall Premiere Elements versions of it that you did before the Microsoft support removal.
    I think a revisit to the Geeks would be in order. It may be that they could not restore Windows XP because of the Microsoft non support. I would take along the Premiere Elements installation disks so that you do not leave there without actually seeing Premiere Elements (or a non Adobe program) running on your restored Windows XP. What was the other software that you tried to use that did not work?
    Please update us on your progress when you get a chance.
    Best wishes
    Thanks.
    ATR
    Add On...spelling correct 12 03 2014.

  • When copying raw files from Extreme IV card to hardrive, finder copies a few files then exits task and wipes the card clean of all images.

    When copying raw files from Extreme IV card to hardrive, finder copies a few files then exits task and wipes the card clean of all images.  Have tried new card and card-reader to no avail.  Have done this many times on other macs with no problems.
    Can edit files off the card, in CameraRaw, prior to 'copying' them, ie can 'save as' to the hard drive, so files seem okay on card, before I try to copy them using copy and paste.
    Running OS 10.8.3 on a new macbook pro.

    Rita,
    The process for determining what is causing the files to be corrupt can be a tedious one depending on the following:
    1. Can you review the images on your camera's LCD screen without problems? If not then the problem is most probably either a corrupted/faulty memory card or a faulty camera. If this is the case then your best bet at recovery (of sorts) is to use a program such as BrezzeBrowser from BreezeSys to extract the embedded jpeg versions of the corrupted RAW files from within each RAW file. Chances are, you won't manage to actually repair the corrupted RAW file but the jpegs are better than nothing.
    2. If the images review ok on your camera but are corrupted when viewing on your computer and there seems to be no other problem with other files on your computer then it may be either a faulty card reader or usb/firewire cable between the card reader and the computer that is the culprit. Try the card reader with a different cable and also try a different card reader to determine the cause of the corruption.
    3. If your symptoms are that you get different files corrupting over time when viewing them on your computer then the problem may be any one of either failing RAM memory, hard disk, hard disk controller or IDE/SATA hard disk cables. This is where the troubleshooting can be pretty tedious testing then eliminating each item from the list of suspicious pieces of hardware. Try the card and card reader on an altogether different computer to see if the files transfer correctly to that computer. If so then the problem lies with your computer hardware. If you haven't already done so at this stage, backup all your important data immediately (hopefully you keep backs anyway).
    Hope this helps.

  • Get the string until first space

    hi,
    can anyone provide an example how to get the string until the first space?
    i mean if the value is :
    this is an example
    how to get only the word "this" (before the very first space) by select?
    thanks in advance,

    There are several methods to achieve this:
    SELECT SUBSTR(t.col1, 1, INSTR(t.col1 || ' ', ' ') - 1)
      FROM (SELECT 'this is an example' col1
              FROM dual) t
         ;     or in 10g using regular expressions:
    SELECT REGEXP_SUBSTR(t.col1, '^[^ ]+')
      FROM (SELECT 'this is an example' col1
              FROM dual) t
         ;     C.

  • I downloaded the trial and can't find it. How do I download pictures and get started.

    I downloaded the trial and can't find it. How do I download pictures and get started.

    What can't you find, the downloaded installer, or the installed program?
    What pictures you want to download?
    What is your operating system?

  • Trying to get the string from javax.xml.transform.Source

    I have a SOAP client that will submit a string of data to a url and return an xml string back. It works ok besides that last part.
    I found on another site someone took the returned XML and printed it to the system print box. I want to just get the string out to a variable to pass back..
    This chunk works:
    TransformerFactory tff = TransformerFactory.newInstance();
    Transformer tf = tff.newTransformer();
    Source sc = rp.getSOAPPart().getContent();
    StreamResult result = new StreamResult(System.out);
    tf.transform(sc, result);
    System.out.println();Instead of this I just want to catch the XML string in a String variable. Thanks for the help.

    Instead of giving your StreamResult System.out, give it a StringWriter. You can then call toString on the StringWriter, and get what you're after
    StringWriter output = new StringWriter();
    TransformerFactory.newInstance().newTransformer().transform(source, new StreamResult(output));
    String xmlResult = output.toString();

  • Day of year bug - format date/time string and scan from string?

    I've noticed that the day of year returned by "Format Date/Time String.vi" starts with a value of 1 for Jan-1 while "Scan from String.vi" wants a 0 index.  Is this a bug or feature?  
    (I'm using Labview 2010 Service Pack 1)

    I think the best idea is to use seconds since for your arithmetic, because it is going to be the most consistent and robust solution. Knowing that a day has 86400 seconds is all that is needed and you won't run in possible inconsistencies with date time implementations caused by our anything but logic calender. I would hazard that the functionality of converting a timestamp into year and day of year and back is impossible to make consistent without sacrificing other possibly conflicting transformation in the Timestamp into String and Timestamp from String manipulations.
    "Seconds since" being the actual base unit in all LabVIEW timestamps, it is best to do any arithmetic on it in this base unit.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Find a specific paragraph style within a table and apply a specific cell style?

    I'm a total beginner when it comes to scripting, but I would like to create a script that finds the paragraph style "resultsUL" within a large table and applies the cell style "female". Sure wish the find/replace was able to account for cell styles as well as paragraph and character styles. Is anyone willing to help me with this? Thank you!

    Hi,
    I do it quickly defining a simple research on the "resultsUL" para style and using a loop with QuicKeys as:
    Cmd-0 is a shortcut associated to the "female" cell style.
    So, What I do: search the para style (Cmd-option-F) and apply the cell style, then search again…
    As easy to do with QuicKeys, I think that can be easily done with a [JS] (faster process!).

  • How can I limit the fonts in the Character Map (charmap) and reinitialize the state after use?

    In a WPF application I have a RichTextBox in which users will be inserting text. I also must give the user the ability to insert characters. To do so I have called up charmap.exe using
    Process charProcess = new Process();
    ProcessStartInfo startInfo = new ProcessStartInfo();
    charProcess.StartInfo.FileName = strCharmap;
    charProcess.Start();
    etc., and it works fine. There are several problems I have basically with charmap, however, not with WPF. The first is that because of the subsequent use of the user’s insertion in the RTB, I must restrict the font to “Ariel Unicode
    MS.”  So far all I have been able to do is instruct and warn the user not to change fonts and 
    change back any font change that occurs as a result of use of “Advanced view” features.
    Question number one is, how can I restrict the fonts loaded into charmap to this one font? The second problem is that if another font is called up, or the “Advanced view” state of charmap is closed, or a “Group by” feature is opened, these choices will
    be retained for the next user that opens charmap. How can I initialize the state of charmap for each new user with the correct font and “Advanced view” features showing. It is said,but in old posts, that reinitialization occurs for all but administrative users,
    but this seems to be no longer true. I have tried permission changes in charmap’s Properties, but I can’t get the necessary reinitialization to occur even if user’s don’t have modify permission. Can one use a .ini file, or the .mui file, or make Registry changes
    to accomplish my goals. There seems to be a warning in the .mui file about changing fonts, but is it cancelled? I am using Windows 7 and C#.
    I have looked at other character maps but they are either too complicated for the casual user, or they have no search engine and advanced features, or they have the same problems.
    I am pretty much a novice with respect to the Windows files use and WPF, so please be fairly clear, complete, and prescriptive in your answer. Also so that I and others can learn, it would be nice to have an explanation of why one does whatever you suggest.
    Your help is appreciated.

    Hi,
    Thanks for your post!
    According to your description, I am afraid your problem is out of support in C#language forum. So i move your thread to off-topic forum!
    Best Wishes!
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and
    makes it easier for other visitors to find the resolution later.

Maybe you are looking for