How to read a string character by character and pass it into an array

Hi,
I have a requirement to write a function.The thing is,i need to read string,replace space with a NULL,return in the form of an arrayy.
for this what i thought is,if the character is not a space,i need to put that into array,if its space,put a NULL for that.
the string is of type varchar2.
ex:XX XX XX
i need some suggestions for this.
thanks

Well, you can just use a loop that runs for the length of the string.
Then for each iteration of the loop, take the next character of the string (substr or similar) and add it to the array. If it's a space, then add a NULL to the array (if that's what you want).
Easy :)

Similar Messages

  • How to read a string from file & assign the val to a variable in batch file

    Hi,
    How to read a string from a file and assign the value to a variable then return the value to the screen in windows batch file?
    Any suggestions?
    thanks.

    Unless this is a homework question then I don't see the purpose of doing this, but....
    You should be looking a the supplied package utl_file to get the string out of the file, dbms_output to display the string and then google windows batch/command files calling sqlplus to execute your program.
    Andre

  • How can I input read a line from a file and output it into the screen?

    How can I input read a line from a file and output it into the screen?
    If I have a file contains html code and I only want the URL, for example, www24.brinkster.com how can I read that into the buffer and write the output into the screen that using Java?
    Any help will be appreciate!
    ======START FILE default.html ========
    <html>
    <body>
    <br><br>
    <center>
    <font size=4 face=arial color=#336699>
    <b>Welcome to a DerekTran's Website!</b><br>
    Underconstructions.... <br>
    </font> </center>
    <font size=3 face=arial color=black> <br>
    Hello,<br>
    <br>
    I've been using the PWS to run the website on NT workstation 4.0. It was working
    fine. <br>
    The URL should be as below: <br>
    http://127.0.0.1/index.htm or http://localhost/index.htm
    <p>And suddently, it stops working, it can't find the connection. I tried to figure
    out what's going on, but still <font color="#FF0000">NO CLUES</font>. Does anyone
    know what's going on? Please see the link for more.... I believe that I setup
    everything correctly and the bugs still flying in the server.... <br>
    Thank you for your help.</P>
    </font>
    <p><font size=3 face=arial color=black>PeerWebServer.doc
    <br>
    <p><font size=3 face=arial color=black>CannotFindServer.doc
    <br>
    <p><font size=3 face=arial color=black>HOSTS file is not found
    <br>
    <p><font size=3 face=arial color=black>LMHOSTS file
    <br>
    <p><font size=3 face=arial color=black>How to Setup PWS on NT
    <BR>
    <p><font size=3 face=arial color=black>Issdmin doc</BR>
    Please be patient while the document is download....</font>
    <font size=3 face=arial color=black><br>If you have any ideas please drop me a
    few words at [email protected] </font><br>
    <br>
    <br>
    </p>
    <p><!--#include file="Hits.asp"--> </p>
    </body>
    </html>
    ========= END OF FILE ===============

    Hi!
    This is a possible solution to your problem.
    import java.io.*;
    class AddressExtractor {
         public static void main(String args[]) throws IOException{
              //retrieve the commandline parameters
              String fileName = "default.html";
              if (args.length != 0)      fileName =args[0];
               else {
                   System.out.println("Usage : java AddressExtractor <htmlfile>");
                   System.exit(0);
              BufferedReader in = new BufferedReader(new FileReader(new File(fileName)));
              StreamTokenizer st = new StreamTokenizer(in);
              st.lowerCaseMode(true);
              st.wordChars('/','/'); //include '/' chars as part of token
              st.wordChars(':',':'); //include ':' chars as part of token
              st.quoteChar('\"'); //set the " quote char
              int i;
              while (st.ttype != StreamTokenizer.TT_EOF) {
                   i = st.nextToken();
                   if (st.ttype == StreamTokenizer.TT_WORD) {          
                        if (st.sval.equals("href")) {               
                             i = st.nextToken(); //the next token (assumed) is the  '=' sign
                             i = st.nextToken(); //then after it is the href value.               
                             getURL(st.sval); //retrieve address
              in.close();
         static void getURL(String s) {     
              //Check string if it has http:// and truncate if it does
              if (s.indexOf("http://") >  -1) {
                   s = s.substring(s.indexOf("http://") + 7, s.length());
              //check if not mailto: do not print otherwise
              if (s.indexOf("mailto:") != -1) return;
              //printout anything after http:// and the next '/'
              //if no '/' then print all
                   if (s.indexOf('/') > -1) {
                        System.out.println(s.substring(0, s.indexOf('/')));
                   } else System.out.println(s);
    }Hope this helps. I used static methods instead of encapsulating everyting into a class.

  • How to read the data from Excel file and Store in XML file using java

    Hi All,
    I got a problem with Excel file.
    My problem is how to read the data from Excel file and Store in XML file using java excel api.
    For getting the data from Excel file what are all the steps i need to follow to get the correct result.
    Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
    Thanks & Regards,
    Sreenu,
    [email protected],
    india,

    If you want someone to do your work, please have the courtesy to provide payment.
    http://www.rentacoder.com

  • How do I copy a photo from iPhoto and paste it into a text/Pages document?

    How do I copy a photo from iPhoto and paste it into a text/Pages document (using iMaC)?

    Use the Media browser in Pages and just drag the image over.

  • How to batch or individual import Canvas .CVX and .CNV files into AI CS6(mac)?

    Is anyone aware how to batch or individually import Canvas .CVX and .CNV files into AI CS6(mac)? I have a large old graphics library representing 10 years of work which would be very nice to convert into Illustrator CS6...
    Thanks a lot for any hint -
    stefan

    JETalmage wrote:
    ...export them as an EPS or another file type that windows will recognize...
    It's not a matter of exporting a file that Windows will recognize; it's a matter of exporting a file format that Illustrator can import or open.
    A Mac OS version of Canvas is under development, by the way.
    JET
    My bad. Typo on my part. I meant one that Adobe will recognize.
    Too early yet. I shouldn't try to type before I get my first morning tea.
    --OB.

  • HT201301 How do I import a garageband project folder (and its contents) into itunes?

    How do I import a garageband project folder (and its contents) into itunes so I can transfer it to my ipad?
    I am a guitar teacher and I want to use garageband for the ipad as a teaching tool for my students.  The goal is for my students and myself to share garageband project files so that both the teacher and the student can have the full project...or even add to it.
    Here's what I need help with...
    My student has created a song in garageband that has 4 tracks.  They sync their song to itunes so they can see the project folder for that song in the document window for garageband under the "apps" tab in itunes.  They click "save to" and save the project folder to dropbox. 
    I want to be able to import the project folder for that song from dropbox into itunes so that I can copy it to my ipad and have full access to my student's song.
    I appreciate any help!  Thanks!
    Pat
    [email protected]

    hi Pat,
    what you can do is add that folder to garageband directory using ifunbox. here is the step:
    - Open your ifunbox then go to "user Applications" on your left panel, then select garageband folder. You will see a folder as below:-
    "Documents"
    "Library"
    "MobileGarageBand.app"
    "tmp"
    "itunesartwork"
    "itunesmetada.plist"
    copy the folder you like to put into your ipad by copy it into "Documents" folder. and then quit the ifunbox and restart your itunes again and sync your ipad again and check if you can see the folder on your file sharing under apps tab. Wish you good luck.

  • How can I delete albums that I created and imported photos into on my iPhone4

    How can I delete albums that I created and imported photos into on my iPhone4

    If you synced the Photos from your computer to your phone, you have to unsync the pictures via iTunes.
    Summary Pane > Photos > Uncheck "Sync Photos from ..."

  • How to download a file from the net and save it into .txt format in a datab

    Can some one show me a tutorial on how to download a file from the net and save it into .txt format in a database?
    Thank you,

    http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html

  • Hi, i purchased a 2 dvd digital set. i cant just download it straight to my ipad. they said i have to down load it to my i tunes, then can transfer to i pad. im not seeing how to click the files from my email, and get them into the i tunes acct... ugh.

    hi, i purchased a 2 dvd digital set. i cant just download it straight to my ipad. they said i have to down load it to my i tunes, then can transfer to i pad. im not seeing how to click the files from my email, and get them into the i tunes acct... ugh.
    i do not have a mac home pc. just a regular pc

    I had the same problem after I gave my old iPad to my parents and tried to install Netflix. This is what you have to do:  Open iTunes on your computer, the one you sync your iPad to. Then go to iTunes Store and search for and download Netflix app. After you download it, if your iPad is set to download new purchases it may start downloading on your iPad. If so, tap and hold to delete the app (because it is trying to install the new version on the iPad) Next step, go to the App Store on your iPad and find Netflix and it should say install since you already purchased it on the computer. Tap to install, and it will say the version is not compatible, tap to download a previous version. Click that and it will install the older version!    One more thing, if and when you sync to your computer again it will say something like " Unable to install Netflix on your iPad" Just click the box to never remind you again, because it's trying to sync the newer Netflix app to your iPad, but it doesn't work so it displays the message. The old app will remain on the ipad. Hope this helps, good luck

  • How to Read a String up to a praticular character

    Hi All,
    This is the String Value "[email protected]" from the string value I have to Read Upto "@" character.
    Could you hlep me how to Read value upto "@" because I have to sent userName to my target structure.
    Thanks and Regards,
    Ashok.

    Ashok,
    You can use StringTokenizer.
    StringTokenizer st = new StringTokenizer("[email protected]","@");
    return ""st.nextToken()"";
    The above value returns you ashokkumar.
    Best regards,
    raj.

  • How to select Specific string after a character

    Hi,
    while creating a user account in discription bar we have the ticket number - Name of owner = managers email id. This format is shown as ex in discription tab of user properties.
    INC000233 - Alex B = [email protected]
    How can i collect string after character "=" i.e
    [email protected]? i tried to use the select string cmdlet but it gives the complete string.
    Please suggest.

    Hi Tommy,
    Thanks it really works and help me. One last daught. There are few entries which are in given format like
    Description - This generic Id is created for test - Luck_Don@domain .com
    So here it gives me error like
    You cannot call a method on a null-valued expression.
    At line:8 char:33
    + $email = $des.split("=")[1].trim <<<< ()
        + CategoryInfo          : InvalidOperation: (trim:String) [], RuntimeExcep
       tion
        + FullyQualifiedErrorId : InvokeMethodOnNull
    I think, this error is popped up becasue " sign is not present at the end of email id. Any idea how to solve this.

  • How to read text file contain chinese character ?

    Hi XI Expert,
    I have scenario to read text file contain Chinese Character using sender file adapter. but every i was check from sxmb_moni all the chinese character looks different. and also the target file also i has changes.
    Please advise me how to maintaine the chinese character in PI 7.0 SP17.
    Thank You and Best Regards
    Fernand

    Hi,
    Refer these threads..
    Receiver file adapter corrupting characters
    Problem in converting special characters in input text file
    Here is one more useful guide..
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42
    Regards,
    Sarvesh
    Edited by: Sarvesh Singh on Nov 17, 2008 3:47 PM

  • How to read the string present in the captcha?

    hi all,
    Can anyone help me out to read the string present in the captcha.
    When a user registers an ID or stuff the user is prompted to enter the image shown.
    i need a code to read the string present in the captcha image.
    hope u get my point.please help me out in coding out for the above.
    Thanks,
    vish

    so dude basically u r trying to make a spam engine?!
    do u think any1 would help u here ? lol
    by the way why do u really need that code ? what are ur intentions ? lol

  • How to read a file with both text and binary data?

    For text data I use a BufferedReader,
    for binary data I use a DataInputStream.
    Since readLine is deprecated in DataInputStream, how can I read in a proper way a file that contains some lines of text followed by some binary data.
    Is there a way to do this without writing a new 'readLine' for DataInputStream (that has to take into account the different newlines for Unix en other OS's)?

    sorry about that ^
    NEW STRING str
    WHILE there is stuff in the file DO
        getByte()
        IF reading a string THEN
            WHILE byte is not a return character DO
                convert the byte to character/string
                append char to str
            WEND
        ELSE IF reading raw data THEN
            parse raw data
            do stuff with it
        END IF
    WEND

Maybe you are looking for

  • Photoshop CC (2014) "not responding" at startup

    Hi, I've just installed Photoshop CC (2014) on my MacBook Pro (Retina, 15-inch, Late 2013), running Mac OS X 10.10.2. On startup I get the "spinning wheel of death" and my CPU run up to 100%. In the "Force Quit Applications" window I get "Photoshop n

  • File Open dialogs in column view do not sort by name

    Any app in OSX that has a Save dialog file browser, some (but not all) of my folders are not sorted alphabetically in column view. Here's how it looks in Safari when I save: Here are my sort options from within that save menu: It's sorted perfectly i

  • Please Help -Videos won't play

    Just purchased a 30 gig 5G black Ipod. Compressed a movie in Quicktime Pro to Ipod settings. Placed movie in my Itunes program. The movies plays fine in Itunes. But when I copy it to the ipod nothing happens. I have been dragging the movie from Itune

  • Deactivating videos when skipping from page to page

    I  have recently purchased a 1 month version of  Flash CC ( 6 ) and installed it on a windows operating system. I am developing a preschool software with videos on each frame and 2-3 two frame animations around it. Now here is my problem - After rend

  • New Time Capsule 2nd generation keeps slowing down internet. Firmware 7.6.3

    Both ethernet and wireless connections, my time capsul ( 2nd gen, 7.6.3) slows down to 20 Mbits after a day or so. I then plug the Modem directly into my laptop, and the speed is 90+ Mbits. I then remove the cable and plug it back into the TC, and th