RegEx Error for Huge File .. Please help , Its Urgent

Hi all,
I am getting following exception,
does anyone know about it
java.lang.IndexOutOfBoundsException: No group 1
at java.util.regex.Matcher.group(Matcher.java:355)
at java.util.regex.Matcher.appendReplacement(Matcher.java:585)
at java.util.regex.Matcher.replaceFirst(Matcher.java:701)
at XSLT_OnlyJava.<init>(XSLT_OnlyJava.java:84)
at XSLT_OnlyJava.main(XSLT_OnlyJava.java:93)
Exception in thread "main"
I am parsing huge file with regex and replacing some part
Thanks,
Vinayak

sorry for late
This is my code
text = contents.toString();
          String regex = "<tu.*?/tu>";
          Matcher matcher = Pattern.compile(regex,Pattern.CASE_INSENSITIVE|Pattern.DOTALL).matcher(text);
          while(matcher.find()){
               tuvSegment = matcher.group();
               String segRegex = "<seg>.*?</seg>";
               Matcher segMatcher = Pattern.compile(segRegex,Pattern.CASE_INSENSITIVE|Pattern.DOTALL).matcher(tuvSegment);
               if(segMatcher.find()){
                    SegVal = segMatcher.group();
               String ReplsegRegex = "<seg />";
               Matcher ReplsegMatcher = Pattern.compile(ReplsegRegex,Pattern.CASE_INSENSITIVE|Pattern.DOTALL).matcher(tuvSegment);
               text = ReplsegMatcher.replaceFirst(SegVal);
The text string contains teh .tmx file
Thanks,
Vinayak

Similar Messages

  • Sql  Query . Please help its urgent.

    Suppose in table EMP there are 2 columns (Roll_no and Name)
    Roll NO Name
    00001 A
    00002 B
    00010 X
    My requirement is to trunc preceding Zero's. For ex : for Roll no: 00001 the output should be 1 and for 00002 --> 2 .
    Please help its very urgent.

    try this
          select
                  to_number(roll_no) roll_no,
                  name
          from
                  emp;
         Regards
    Singh

  • ERROR MASSAGE 47:01, PLEASE HELP ME, URGENT

    TO ALL WHO EXPERT IN HP DESIGNJET T610,
     NOW IM FACING PROBLEM WITH MY PLOTTER, ONE ERROR MASSAGE APPEAR ON DISPLAY SCREEN.
    MASSAGE SHOW NO 47.01 ERROR, WHAT THATS MEAN? AND PLEASE SHOW ME THE WAY AND HELP ME TO SOLVE THE PROBLEM.
    THANK YOU FOR YOUR KIND TO HELP ME
    REGARD
    JOE

    TO ALL WHO EXPERT IN HP DESIGNJET T610,
     NOW IM FACING PROBLEM WITH MY PLOTTER, ONE ERROR MASSAGE APPEAR ON DISPLAY SCREEN.
    MASSAGE SHOW NO 47.01 ERROR, WHAT THATS MEAN? AND PLEASE SHOW ME THE WAY AND HELP ME TO SOLVE THE PROBLEM.
    THANK YOU FOR YOUR KIND TO HELP ME
    REGARD
    JOE

  • How can maintain log file Please help Very Urgent.

    I am developping an application in PDK. From my application I need maintain a log file in the server side. Please help me how can I do this. If you do have links regarding this matter please pass it.

    You might want to use the SAP Logging API. see
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/d2/5c830ca67fd842b2e87b0c341c64cd/frameset.htm">Logging and Tracing</a>
    In NWDS include a reference to logging.jar (use variable SAP_LOGGING_LIB_HOME).
    You can then write to the log in this way:
    public class Xyz {
         private static final Location TRACE = Location.getLocation(Xyz.class);
         // It is not nice to set the severity in static code - only for demonstration purposes.
         // For production-ready code this should be done via a log-configuration.xml
         // to allow configuration of the severity at runtime.
              TRACE.setEffectiveSeverity(Severity.ALL);
         public void myMethod() {
              final String METHOD = "myMethod()";
              TRACE.entering(METHOD);
              TRACE.debugT("whatever");
              TRACE.exiting(METHOD);

  • Please Help its Urgent ***POPUP at the time of MIGO Posting*****

    Hi all,
    Please help me on this issue,
    I want to display one popup at the time of migo posting and that popup ask to user that " How much labels you wants to print?" and in next of that i want one text box or input field in that user inputs the number of labels he wants to print.
    I have tried using various POPUP functions but i have not got any FM which fulfill my requirement so please help me on this issue?
    Kind Regards
    Sudarshan Gaikwad

    The standart POPUP* function modules seem to either give an option to output descriptive text, or ask for a dictionary based field as an input.  As you want both in one popup you may need to write your own custom pop-up.
    Create a function group with a Z function module and add a dialog screen with the required text and input field to this function group.
    Take a look at function POPUP_GET_VALUES as an example - A custom written one could be a lot simpler.
    Then call this function from your user exit.
    Andrew

  • Please Help its urgent........requirement is to read a .gz file

    and to randomly acces it...
    If i read the file line by line using GZIPInputStream it takes lot of time...
    My requirement is to pick some line (say 35000) randomly......
    Please suggest any alternative.....

    use this code to unzip a .gzip file:
    try {
            // Open the compressed file
            String inFilename = "infile.gzip";
            GZIPInputStream in = new GZIPInputStream(new FileInputStream(inFilename));
            // Open the output file
            String outFilename = "outfile";
            OutputStream out = new FileOutputStream(outFilename);
            // Transfer bytes from the compressed file to the output file
            byte[] buf = new byte[1024];
            int len;
            while ((len = in.read(buf)) > 0) {
                out.write(buf, 0, len);
            // Close the file and stream
            in.close();
            out.close();
        } catch (IOException e) {
        }

  • Doctype for xml file please help

    hi everybody
    I want to create a xml document from document class but how do I set the doctype to .dtd file I don�t see any create method like create element

    createDocumentType() method in the DOMImplementation generates a doctype node.
    createDocumentType(String qualifiedName,
    String publicId,
    String systemId)
    qualifiedName - The qualified name of the document type to be created.
    publicId - The external subset public identifier.
    systemId - The external subset system identifier

  • Iphone 5 troubles, please help, its urgent!

    I got this new iphone 5, but i wanted my music and photos to go on it from my ipod 4th generation, so i connected my ipod to my computer and itunes and backed it up, when i plugged in my iphone, its said to back it up (hoping my files would transfer like it intended it would, i did so) .. except it turned my iphone 5 into an ipod, they layout was the same, the settings were the same, please i need help and i want to see my iphone back to the way i had it when i got it earlier today. I've tried all the resets and it still won't work

    Download the ipsw for your iphone, then open itunes and press shift (on windows) or option (on Mac), while holding that button click on restore, then you can selecte where to restore from, select the file you just downloaded, make sure is the latest version, and check if your phone is CDMA or GSM before downloading the file.
    You might be able to find the ispw on google

  • PLEASE HELP ITS URGENT (PROBLEM IN INCLUDE)

    IF I EXECUTE IN 4.6C ITS NOT GIVIN NY ERROR BUT THE SAME CODE IN 6.0 IS GIVING ERROR
    IF NOT ( ( text_flag = 'X' AND tcode_level > 0 ) OR
                 ( text_flag_level0 = 'X' AND
                   tcode_level      = 0   AND          )    ).
    ERROR IS:
    Incorrect logical expression: "AND" or "OR" must be preceded by an          
    expression (e.g. a comparison).          
    PLZ HELP ME AS IT IS VERY URGENT.
    THANX IN ADVANCE

    Hi anit,
    1. minor mistake
    2. remove this AND in bold.
    IF NOT ( ( text_flag = 'X' AND tcode_level > 0 ) OR
    ( text_flag_level0 = 'X' AND
    tcode_level = 0 <b>AND</b> ) ).
    regards,
    amit m.

  • Problem with client side printing, please help its urgent

    hi ,
    am using struts and jasper reports on my project, now i was having problem that whenever i try to print the report , the printer dialogue box was appearing on server machine, i want it on client end, how to solve this problem, please any one know help me, it was urgent,
    my code was like this
    JasperCompileManager.compileReportToFile("c:/report/test.jrxml","c:/report/test.jasper");
    JasperPrint jasperPrint = JasperFillManager.fillReport("c:/report/test.jasper"),parameters,con);
    List l=jasperPrint.getPages();                         
    if(l.size() != 0){
      jasperPrint.setOrientation(JasperReport.ORIENTATION_PORTRAIT);
      jasperPrint.setPageHeight(877);
      jasperPrint.setPageWidth(963);
      JasperPrintManager.printPages(jasperPrint,0,l.size()-1,true);
    }thanks in advance,

    Double post.

  • I am having problem when i am updating my iphone 4 to ios 5 ..it get update n took 50 minutes then at the end when it was processing file ...suddenly an error comes that an unknown error accurred {9006}..please help me..how will i update my iphone 4

    i am having problem when i am updating my iphone 4 to ios 5 ..it get update n took 50 minutes then at the end when it was processing file ...suddenly an error comes that an unknown error accurred {9006}..please help me..how will i update my iphone 4

    Error 9006: Following Troubleshooting security software frequently resolves this error. There may be third-party software installed that modifies your default packet size in Windows by inserting a TcpWindowSize entry into your Registry. Your default packet size being set incorrectly can cause this error. Contact the manufacturer of the software that installed the packet size modification for assistance.

  • I'm getting this problem when trying to update my iphone 3gs it says that the iphone software could not be contacted and I went on youtube got some advise to go into my hard drive to fix the error I have nothing in my host file please help me if you can

    I'm getting this problem when trying to update my iphone 3gs it says that the iphone software could not be contacted and I went on youtube got some advise to go into my hard drive to fix the error I have nothing in my host file please help me if you can this is all new to me.

    Read this: iOS 4: Updating your device to iOS 5 or later
    ... oh I think it is a 3gs or a 3
    This makes a difference. What does it say in Settings > General > About?

  • Help - i recently made put together a high quality movie for a relative, it has taken me months to complete and it goes for a total of 9 hours and 43 minutes ,however, it won't let me export the video at all! please help - its taken ages to make it!

    Help - i recently made put together a high quality movie for a relative, it has taken me months to complete and it goes for a total of 9 hours and 43 minutes ,however, it won't let me export the video at all! please help - its taken ages to make it!

    9 hours??!
    Twice the length of a cinema epic?
    How are you expecting to distribute it?
    iDVD encoding settings:
    http://docs.info.apple.com/article.html?path=iDVD/7.0/en/11417.html
    Short version:
    Best Performance is for videos of up to 60 minutes
    Best Quality is for videos of up to 120 minutes
    Professional Quality is also for up to 120 minutes but even higher quality (and takes much longer)
    That was for single-layer DVDs. Double these numbers for dual-layer DVDs.
    Professional Quality: The Professional Quality option uses advanced technology to encode your video, resulting in the best quality of video possible on your burned DVD. You can select this option regardless of your project’s duration (up to 2 hours of video for a single-layer disc and 4 hours for a double-layer disc). Because Professional Quality encoding is time-consuming (requiring about twice as much time to encode a project as the High Quality option, for example) choose it only if you are not concerned abo
    In both cases the maximum length includes titles, transitions and effects etc. Allow about 15 minutes for these.
    You can use the amount of video in your project as a rough determination of which method to choose. If your project has an hour or less of video (for a single-layer disc), choose Best Performance. If it has between 1 and 2 hours of video (for a single-layer disc), choose High Quality. If you want the best possible encoding quality for projects that are up to 2 hours (for a single-layer disc), choose Professional Quality. This option takes about twice as long as the High Quality option, so select it only if time is not an issue for you.
    Use the Capacity meter in the Project Info window (choose Project > Project Info) to determine how many minutes of video your project contains.
    NOTE: With the Best Performance setting, you can turn background encoding off by choosing Advanced > “Encode in Background.” The checkmark is removed to show it’s no longer selected. Turning off background encoding can help performance if your system seems sluggish.
    And whilst checking these settings in iDVD Preferences, make sure that the settings for NTSC/PAL and DV/DV Widescreen are also what you want.
    http://support.apple.com/kb/HT1502?viewlocale=en_US

  • HT201263 Hi. I forgot my passcode and now I am unable to unlock my ipod. I tried restoring it using itunes in recovery mode as well as dfu mode but it says unable to restore,unknown error occured (3004).  Please help me out. My ipod is locked for one hour

    Hi. I forgot my passcode and now I am unable to unlock my ipod. I tried restoring it using itunes in recovery mode as well as dfu mode but it says unable to restore,unknown error occured (3004).  Please help me out. My ipod is locked for one hour now.

    Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device: Several Alternative Solutions
    1. iOS- Forgotten passcode or device disabled after entering wrong passcode
    2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
    3. Restoring iPod touch after forgotten passcode
    4. What to Do If You've Forgotten Your iPhone's Passcode
    5. iOS- Understanding passcodes
    6. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
    Forgotten Restrictions Passcode Help
    You will need to restore your device as New to remove a Restrictions passcode. Go through the normal process to restore your device, but when you see the options to restore as New or from a backup, be sure to choose New.
    Also, see iTunes- Restoring iOS software.

  • HT4623 i disconnected my iphone 4 while it was updating and now its frozen, the screen is showing a apple logo and a loading bar which has been for 9hrs now. please help

    i disconnected my iphone 4 while it was updating and now its frozen, the screen is showing a apple logo and a loading bar which has been for 9hrs now. please help

    It's not uncommon for it to not work the first time and sometimes, you have to try it a few times. Turn off your antivirus software and your firewall while you are trying to restore the iPad. Enable them again after you restore.
    If that still won't work, post back with detailed information as to what exactly does happen as you go through the process.

Maybe you are looking for