Please figure out the error

hi all,
heres a problem I can't it out can any one help me.
Its not printing the WieldValue5
the String here it should ignore "SXGI", "F"'s, and "E" and it should print ControlID1
WieldType1
WieldValue1
ControlID5
WieldType5
WieldValue5
its not printing "WieldValue5"
public class Example {
     public static void main(String[] args) throws Exception {
          String strReq = "SXGIDFControlID1FWieldType1FWieldValue1F" +
                               "ControlID2FWieldType2FWieldValue2F" +
                               "ControlID3FWieldType3FWieldValue3F" +
                               "ControlID4FWieldType4FWieldValue4F" +
                               "ControlID5FWieldType5FWieldValue5E";
          int iIndexF = strReq.indexOf("F");
          String strTemp = strReq.substring(iIndexF + 1);
          int iIndexE = -1;
          while(-1 != iIndexF) {
               iIndexF = strTemp.indexOf("F");
               if(-1 == iIndexF) {
                    throw new Exception("Error in ControlID");
                    String strControlID = strTemp.substring(0, iIndexF);
                    System.out.println(strControlID);
               int iIndexFieldType = strTemp.indexOf("F", iIndexF + 1);
               if(-1 == iIndexFieldType) {
                    throw new Exception("Error in FieldType");
                    String strFieldType = strTemp.substring(iIndexF + 1, iIndexFieldType);
                    System.out.println(strFieldType);
               int iIndexFieldValue = strTemp.indexOf("F", iIndexFieldType + 1);
               String strFieldValue;
               if(-1 == iIndexFieldValue) {
                    throw new Exception("Error in FieldValue");
               strFieldValue = strTemp.substring(iIndexFieldType + 1, iIndexFieldValue);
               System.out.println(strFieldValue);
               iIndexF = iIndexFieldValue;
               if(-1 == iIndexF) {
                    iIndexE = strTemp.indexOf("E", iIndexFieldType + 1);
                    if(-1 == iIndexE) {
                         throw new Exception("Error in FieldValue");
                    strFieldValue = strTemp.substring(iIndexFieldType + 1, iIndexE);
                    System.out.println(strFieldValue);
                    iIndexFieldType = iIndexE;
               strTemp = strTemp.substring(iIndexFieldValue + 1);
               System.out.println(strTemp);
}null
null

Based on the information you've provided, here's a stripped down version:
    String strReq = "SXGIDFControlID1FWieldType1FWieldValue1F" +
                    "ControlID2FWieldType2FWieldValue2F" +
                    "ControlID3FWieldType3FWieldValue3F" +
                    "ControlID4FWieldType4FWieldValue4F" +
                    "ControlID5FWieldType5FWieldValue5E";
    int    beg   = 0, end   = 0;
    while ( true ) {
      beg = strReq.indexOf("F",beg);
      end = strReq.indexOf("F",beg+1);
      if (beg != -1) {
        if ( end == -1) {
          end = strReq.indexOf("E",beg+1);
          if ( end == -1)
            end = strReq.length();
        System.out.println(strReq.substring(beg+1,end));
      else
        break;
      beg = end;
    }

Similar Messages

  • Cant figure out the error

    public void datfileout()
    try
    BufferedWriter outstream = new BufferedWriter(new FileWriter("character.txt"));//declares variable that reads in from file
    for(int x=0;x<holdinfo.size();x++)
    outstream.write((String)holdinfo.get(x));//writes names to file
    outstream.newLine();//starts a new line
    outstream.close(); //closes file
    catch (Exception e)
    System.err.println("Caught exception " + e.toString());//checks for an error
    this is what i have attempted to put in an applet but it seems just to freeze every time i go in this method what should i do?

    Your code works for me :
    * Applet_Test.java
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    public class Applet_Test extends JApplet {
        public void init() {
            datfileout();
            System.out.println("Applet_Test is OK");
        ArrayList holdinfo = new ArrayList();{
            holdinfo.add("Test 1");
            holdinfo.add("Test 2");
            holdinfo.add("Test 3");
        public void datfileout() {
            try {
                BufferedWriter outstream = new BufferedWriter(new FileWriter("character.txt"));
                for(int x=0;x<holdinfo.size();x++) {
                    outstream.write((String)holdinfo.get(x));//writes names to file
                    outstream.newLine();//starts a new line
                outstream.close(); //closes file
            } catch (Exception e) {
                System.err.println("Caught exception " + e.toString());//checks for an error
    }

  • Need help with my batch code, cant seem to figure out the errors.

    Hello all, so as part of my job I have to check a list of shared drives on random servers throughout the world to make sure they are not open. I am trying to make a batch file to check them all at once instead of mapping to each one individually. It would
    save a lot of time. So far I got this code with the help of a member of
    reddit:
    @echo off
    :: Ensure Extensions are enabled to avoid silent failure
    setlocal EnableExtensions DisableDelayedExpansion
    set "Input-Server-List=H:\Desktop\serverlist.txt"
    set "Open-Share-List=H:\Desktop\open_shares.txt"
    set "Locked-Share-List=H:\Desktop\locked_shares.txt"
    :: Create empty files
    copy nul "%Open-Share-List%" 1>nul
    copy nul "%Locked-Share-List%" 1>nul
    :: Test the shares to see if they're online or not
    for /f "usebackq delims=" %%S in ("%Input-Server-List%") do @(
    pushd "%%~S" 2>nul && (
    popd
    1>> "%Open-Share-List%" echo %%~S
    echo ONLINE -- %%S
    ) || (
    1>> "%Locked-Share-List%" echo %%~S
    echo OFFLINE - %%S
    echo Testing Complete! Results have been logged to File.
    :: Open files in default program (typically notepad.exe)
    explorer "%Open-Share-List%"
    explorer "%Locked-Share-List%"
    :: End of script
    endlocal
    timeout -1 /nobreak
    exit /b
    But there are a few (approx 4) servers that are coming up as online/accessible in the list that are actually closed/appropriately locked down. I have no idea why.. all the rest are working as they should. Any help would be much appreciated. Any questions
    let me know. Once again, I would really really appreciate some help.

    Here's a tester:
    Get-Content .\shareList.txt | ForEach {
    $share = $_
    If (Test-Path -Path $share) {
    $found = $true
    } Else {
    $found = $false
    try {
    $null = Get-ChildItem -Path $share -ErrorAction Stop
    $connect = $true
    } catch {
    $connect = $false
    $props = @{
    Share = $share
    Found = $found
    Connect = $connect
    New-Object PsObject -Property $props
    } | Select Share,Found,Connect |
    Sort Connect,Share |
    Export-Csv .\shareListCheck.csv -NoTypeInformation
    As the others have pointed out though, this won't really give you any solid information.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Open pdf says "please fill out the following form" when I attempt to apply redactions, I get an error message.  How do I "turn off" the form portion of the document?  I assume that is the problem since I have not had this issue with any of the other files

    I am attempting to redact a large pdf file.  When I open the file, it has a bar across the top with the message "please fill out the following form".  I can mark redactions, but when I attempt to apply them I get a message saying, "In order to proceed Digital Signatures must be removed and the document must be fully authorized.  Do you want to make these changes and continue?"   I click "ok".  Then I get a message saying, "an internal error occurred."  How do I get around this problem?

    You cannot redact a signed document. This is because one of the things signatures guarantee is access to the OLDER document (i.e. there will be an unredacted copy in there).
    In general you cannot remove signatures, but sometimes you can. Look under the Signatures tab (right click on left vertical bar if there isn't one) to see if it is removable.

  • The screen of my MacBook Pro itself periodically switches the color. That is, with the usual colors, on some blue. What to do? Should be repaired, or you can figure out the most? HELP ME PLEASE!

    The screen of my laptop itself periodically switches the color. That is, with the usual colors, on some blue. What to do? Should be repaired, or you can figure out the most? HELP ME PLEASE!

    LambChops1,
    I’m using Mavericks, and it’s still possible to select text to drag and for cutting and pasting. Left-clicking and right-clicking is still possible, too.
    Try opening the Trackpad pane of System Preferences, and select the Point & Click tab. To right-click, ensure that your “Secondary click” checkbox has been checked; the small print under “Secondary click” is a dropdown menu which allows you to select the form of right-clicking that you prefer. (For instance, mine is set to “Click in bottom right corner”.) For left-clicking, is your “Tap to click” checkbox checked, or unchecked? (Mine is unchecked, since I prefer pushing for left-clicking over tapping to do so.)

  • Hi Experts , I am currently facing problems while running restricted version copy .. The log says 0 location products copied and that the process has has timed out. the error message is /SAPAPO/MVM_INT_SVC_CO_VER_LCW reported exception in task DP00014, th

    Hi Experts , I am currently facing problems while running restricted version copy in sap apo .. The log says 0 location products copied and that the process has timed out. the error message is " /SAPAPO/MVM_INT_SVC_CO_VER_LCW reported exception in task DP00014 " , then ending in time limit exceeded. could anyone explain why this happens. please note even if the log says 0 location products copied , in reality they have have been partially copied.
    Regards
    Jerel

    Hi, thank you for your replies, I found out few things about my servlet, and its portability
    and i have few questions, although i marked this topic as answered i guess its ok to post
    I am using javax.servlet.context.tempdir to store my files in that servletcontext temporary directory. But i dont know how to give hyperlink
    of the modified files to the user for them to download the modified files.
    What i am using to get the tempdir i will paste
    File baseurl = (File)this.getServletContext().getAttribute("javax.servlet.context.tempdir");
    System.out.println(baseurl);
    baseurl = new File(baseurl.getAbsolutePath()+File.separator+"temp"+File.separator+"files");
    baseurl.mkdirs();so i am storing my files in that temp/files folder and the servlet processes them and modifies them, then how to present them as
    links to the user for download ?
    and as the servlet is multithreaded by nature, if my servlet gets 2 different requests with same file names, i guess one of them will be overwritten
    And i want to create unique directory for each request made to the servlet , so file names dont clash.
    one another thing is that i want my servlet to be executed by my <form action> only, I dont want the user to simply type url and trigger the servlet
    Reply A.S.A.P. please..
    Thanks and regards,
    Mihir Pandya

  • I am moving from Southern California to Maui, Hawaii and I need to figure out the best way to get my 24 inch iMac across the ocean. Does anyone know the best way to do this?

    I am moving from Southern California to Maui, Hawaii and I need to figure out the best way to get my 24 inch iMac across the ocean. Does anyone know the best way to do this? I have found GearGrip's LCD harness so that I can do carry-on onto the plane...  Or maybe use a Pelican Case to do it as a "checked bag"? Or any other suggestions??! Please help!
    Thanks so much!!

    I don't recommend you send the iMac in a checked bag. Might get damaged.
    Check the airlines website for carry on guidelines.
    Or, if you have the original box that the iMac came in, if you have someone who can pick up the iMac for you, send it ahead Fed Ex and insure the package.
    Just make sure the display is covered to protect it. A blanket perhaps.
    Aloha ...

  • Unable to figure out the classnotfoundException

    Dear Members,
    I have an applet on which I want to show images. I have put .class and .html in the same directory and the images in the images directory.
    I'm usong Tomcat 5.5.4.
    Note: I have created certificates and also policy files for the applet.
    When I run the same code using eclipse, the code is working fine.
    And when I try to run in the browser its throwing the following Exceptions.
    java.lang.NoClassDefFoundError: AdminApplet1$1
         at AdminApplet1.init(AdminApplet1.java:74)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source) Where AdminApplet1 is my applet.
    Following is the code written in the .html
    <applet codebase="http://localhost:8080/project/"
            code="AdminApplet1"
            archive="SAdminApplet1.jar"
            height=400
            width=600 >
    </applet>where SAdminApplet1.jar is signed jar.
    I'm trying to figure out the problem since last 2 days. If you want more details about the problem please let me know.
    I have referred http://java.sun.com/developer/technicalArticles/Security/Signed/
    for creating the certificates
    If you think I've gone wrong while creating the certificate then please show me a way.
    I'm looking forward for the helping hands.
    Thanks.

    Please put all the class files in the jar.
    Considor this example:
    import java.applet.*;
    public class test extends Applet {
         public void start() {
              System.out.println("this is start");
              try{
                   System.out.println(System.getProperty("java.version"));
                   (new subTest()).printSomething();
              }catch(Exception e){
                   e.printStackTrace();
         public void init(){
              System.out.println("this is init");
         class subTest{
              void printSomething(){
                   System.out.println("something");
    }compiling with javac test.java gives me:
    test.class
    test$subTest.class
    When I remove test$subTest.class and open the applet with a html page I get:
    java.lang.NoClassDefFoundError: test$subTest
    (looks familiar?)

  • Help! I figured out the problem - sort of.

    So I posted my problem two days ago. I found that only some of my pages were loading in Firefox 3. I didn't know why (see below for original posting).
    With a little experimenting, I have found that republishing the pages that "work" actually causes them to no longer work. I'm pretty sure I published these pages that worked with previous versions of iWeb. Now that I'm using the latest version of iWeb, any new pages (blogs) cannot be viewed by Firefox 3.
    Is there anyone out there with a work around? Solution? Anyone?
    HERE IS THE ORIGINAL POST:
    HELP- Take a look at my pages- What's wrong?
    Posted: Nov 19, 2008 3:19 PM
    Reply Email
    Here are links to my pages: the first link doesn't load in Firefox 3. The second link loads fine. I can't figure out the difference between the two pages. Any web gurus out there that can determine my problem? I really want people using firefox to be able to view my site.
    THANKS!!
    LINK 1:
    http://web.me.com/reeldamian/DAMIANDP.COMNYO/COMMERCIAL_REEL/COMMERCIALREEL.html
    LINK 2:
    http://web.me.com/reeldamian/DAMIANDP.COM_NYO/FX/FX.html
    Message was edited by: 3pointer

    I installed oracle apps 11.5.10.2 using steps given in thread and I didnt have any problems. I then installed it on my friends laptop and it worked fine. but recenly it stopped working in my laptop, i was not able to open login page from main url (http://www.msb.ora:8000) it gave error : page cannot be found
    So i reinstalled it on fresh system again.. but since then it not working. I have tried atleast 9-10 times and everytime it ends up with same error "jsp is not responding", I am able to open the rapid install main page but I am not able to open login page. it says page cannot be found. i followed all the steps suggested by you guys in this thread to solve this error, but still have no luck.
    I have tried following steps to solve the issue
    1) As its recommended to installed apps on fressh os without jdk i did the same, as i didnt worked i tried installation with jdk preinstalled,
    2) i have tried on both windows server 2003 and win xp professional
    3) I tried to change the jdk path in jser.properties file
    I will really appriciate any help to solve this problem. Below is system details:
    os: windows server 2003
    ram : 1gb
    processor: 1.83ghz core 2 duo
    Oracle apps 11.5.10.2
    java version: 1.4.2_04 ( installed by rapidwiz)

  • How do I figure out the size of an image in my iPhoto. How do I know if it is Kilobytes or megabytes. I assume Megabytes are larger than kilobytes and gigabytes are largest.

    How do I figure out the size of an image in my iPhoto. Soe applications require a certain size and I have no way of knowing what they are.
    Please confirm that Kilobytes are smaller than megabytes and gigabytes are the largest.

    You're correct, Kilobytes are smaller than megabytes and gigabytes are the largest.
    When you attach the images to an email, look on the bottom line for the total size of the email.  You can also change the image from Actual size to medium or small.

  • Help figuring out the next step

    Credit card became invalid and so I needed to resign up. I created a different log in and pass word because I couldn't remember the original log in and pass.  I have already paid for a new subscription and removed and redownloaded skype but when I try to use skype it says I need a subscription.  I need help figuring out the next step because it won't let me skype to a mobile in Togo Africia and I have already paid for a new subscription  with my new credit card.  Help!! Donna  

    you can visit the link below for instructions on how to check the status of your current order;
    https://support.skype.com/en/faq/FA288/what-is-the-status-of-my-order
    if you need further assistance, you can also try to contact customer service. Just open the link pasted below to see the instructions on how to get in touch with customer service -
    https://support.skype.com/en/faq/FA1170/how-can-i-contact-skype-customer-service
    IF YOU FOUND OUR POST USEFUL THEN PLEASE GIVE "KUDOS". IF IT HELPED TO FIX YOUR ISSUE PLEASE MARK IT AS A "SOLUTION" TO HELP OTHERS. THANKS!
    ALTERNATIVE SKYPE DOWNLOAD LINKS | HOW TO RECORD SKYPE VIDEO CALLS | HOW TO HANDLE SUSPICIOS CALLS AND MESSAGES

  • SAPscript - Cheque layout changes - suggestions on figuring out the exact

    Hi,
    I have been given a cheque layout prepared with a third party software.
    This layout has information about all components (check box, check date, routing number, check number...) and where exactly each one of them has to appear on the cheque.
    The form has some specifications like '.075 inches space between amount and currency', 'the routing number has to print from box 54 to 47' etc.
    Can you please give some guidelines on how to proceed figuring out the location of each page window, paragraph formats, character formats to create etc. I have make sure they (check, address details...) are exactly printed at the specified position.
    Version: SAP 4.6c
    Thanks in advance.
    With Best Regards,
    Vidya

    Vidya,
    Be ready to walk from your pc to the printer workstation umpteen times till you deliver this object.
    That is the only way that we can ensure whether the data is getting printed at the desired place or not.
    "Cheque printing"-use this key word and search in SDN to see tons of info.
    K.Kiran.

  • I need help figuring out the best way to convert analogue video to DV so that I can edit it.

    I have a large number of VHS and hi8 tapes that I want to convert to high quality DV.
    I have a couple of options. One is an Elgado Video capture system.
    The other is a Sony Digital Media Converter Box (DVMC-DA2).
    I have tried a few of the less important tapes using the Elgado Video Capture system. It only allows you to convert to MPEG4 or H.268. It is not very good quality, especially for archival items or items I would later wish to edit.
    I also have the Sony Digital Media Converter Box. I have heard that this is a superior option. So far, though, I have only been able to figure out how to import using an old version of iMovie HD. This makes a large imovie project file (approximately 6.18GB for a 28:30 clip vs a 348.9MB for an MPEG4 using delgado.
    On top of that to convert the file from an iMovieProject file to DV is an additional step that so far looks like will take a half an hour at best.
    Is there any way for me to import VHS/hi8 tapes using the Digital Media Converter Box to creat high quality DV files directly? If so, where can I find this info? What steps should I take and what are the settings I should use.
    I have a lot of tapes so I want to figure out the right and most efficient way to do this because I will be repeating it a bunch of times and would hate to have to start over again.
    I should also mention that I am using a Mid 2010 MacBook Pro, with OSX 10.9.1
    I'm sorry in advance if this seems like an obvious question, but I have been googling and looking at tutorials on the site and just have not found the answer. There are a lot of ads for expensive low quality services to do this converting for you, so maybe the answer I am looking for is burried in all that advertising.
    Thanks

    Thanks Biggles and Gotz. I just couldint find capture, but now I can! (It was right under my nose too).
    I'm trying it now and it appears to be working. Do you have any other recommendations for capturing from hi8 video source as far as setting go? I am using DV to capture. Are there any other settings I should pay attention to?
    There is an extra line of video noise at the bottom, but when I google it, it sounds like it won't show on most standard tvs and if I want to fix it for online, that I should mask it after the fact vs scaling up the video.

  • Is there a way to figure out the name behind an Apple ID?

    Is there a way to figure out the name behind an Apple ID?  My oganization uses an iPad as a kiosk.  Somone accessed the iPad, changed the Apple ID associated with iTunes, downloaded a game and set a password to lock up the whole iPad.  We had to completely restore the iPad in order to access it.  When I tried to upload a new app, a different Apple ID popped up, and I'm assuming it was the person who locked the iPad and downloaded the game.  I would like to figure out who owns that account, just so we can not allow that person access to the iPads anymore.
    Is there a way to do this?

    The Apple Support Communities are an international user to user technical support forum. As a man from Mexico, Spanish is my native tongue. I do not speak English very well, however, I do write in English with the aid of the Mac OS X spelling and grammar checks. I also live in a culture perhaps very very different from your own. When offering advice in the ASC, my comments are not meant to be anything more than helpful and certainly not to be taken as insults.
    Perhaps with a court order because the person committed a criminal act. Otherwise it is doubtful that Apple would violate the privacy of a client/account holder just on your word.

  • Is there a way to dynamically figure out the FIRSTROW & LASTROW using Bulk Insert?

    I noticed most of my files follow a certain convention, so I can use Bulk Insert with this:
    FIRSTROW = 2, LASTROW = 224
    However a few files have many more records.  I'd like SQL Server to dynamically figure out the first and last rows with data, but I don't know if that's possible.  Can someone confirm?
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Nope, you would need read the files from some program. Could be a CLR stored procedure if you want to do it from SQL Server. But from BULK INSERT alone, no.
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for