Regex to match all exept at beginning of line

Hi, is it possible to do this in java?
I'd like to replace all "+" with "&+", exept if there's a "+" at start of the line
"dsadsa+dasdsa+das" -> "dsadsa&+dasdsa&+das"
"+dsadsa+dasdsa+das" -> "+dsadsa&+dasdsa&+das"

T.B.M wrote:
(?<! something ) says look behind (<) for NOT (!) something. In the example the NOT is the start of the line (^) . So, if the next character is a '+' but when we look behind we don't see the start of the line then we have a match.Thanks for explaining :-)
Also, I tested by changing ^ to another regex, it appeared to be working correctly. This means, ^ can be any regex instead of just a character (Can you please confirm?).That is why I said 'something' and not 'character'
I am asking this because when I tried:
System.out.println("+123+dsadsa+dasdsa+das".replaceAll("(?<!^\\+123)\\+", "&+"));It worked correctly, but when I tried:
System.out.println("+123+dsadsa+dasdsa+das".replaceAll("(?<!^\\+\\d*)\\+", "&+"));Following exception was thrown:
java.util.regex.PatternSyntaxException: Look-behind group does not have an obvious maximum length near index 9Does this mean we can use regex, but without quantifiers ?* and + quantifiers are not allowed but {4,7} quantifiers are allowed. There are bugs in the look behind but as long as as you stick to fixed length or range 'something' then you won't hit them.
>
Thanks again for explaining!

Similar Messages

  • Regex not matching an expression

    Hello, I've just started using regular expressions and I have a question: I've wanted to create a regex which matches all strings starting with <!-- and possibly ending with -->, with the exception that the string --> cannot appear in the middle of the matching text. To do this, I wrote the following pattern:
    \Q<!--\E[!(\Q-->\E)]*(\Q-->\E)?I'm quite aware that it's a bad idea not telling the regex what to match, but rather what not to match, as it is very vague and probably inefficient, however, I did expect this to work nonetheless, which it just doesn't. It does match the string "<!--" but no further (i.e, not "<!-- a"). What did I get wrong? (There's probably a much better way to do this, however, as I said, I'm a regex newbie).
    thanks,
    laginimaineb.

    The closes I got was:
    "\\Q<!--\\E[^(\\Q-->\\E)]*(?:(\\Q-->\\E)?+)"Which seemed to work well until I tried the last little sample in the below code:
    package net.luke;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    public class RegexEr {
          * @param args
         public static void main(String[] args) {
              //Starts with <!--, then has any characters except --> 0 or more times, and ends with --> 0 or 1 times.
              String pattern = "\\Q<!--\\E[^(\\Q-->\\E)]*(?:(\\Q-->\\E)?+)";
              String[] searches = new String[] {
                        "<!--", "<!-- Hey", "<!-- Hey \n\rThere",
                        "Hey There <!-- You dog --> you.", "Huh <!-- What did --> you say -->?",
                        "I <!-- just need --> to <!-- make up --> some strings.",
                        "But <!-- 123--456>7?-->"};
              Pattern p = Pattern.compile(pattern);
              Matcher m;
              for (int i = 0; i < searches.length; i++) {
                   m = p.matcher(searches);
                   while (m.find()) {
                        System.out.println(m.group());
    Results: <!--
    <!-- Hey
    <!-- Hey
    There
    <!-- You dog -->
    <!-- What did -->
    <!-- just need -->
    <!-- make up -->
    <!-- 123
    -- Edit --
    Which, when I clean it up doesn't turn out much different that yours:"\\Q<!--\\E[^(\\Q-->\\E)]*(\\Q-->\\E)?"Edited by: stevejluke on Jul 23, 2008 8:00 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Match beginning of line with Regular Expression

    I'm confused about dreamweaver's treatment of the characters
    ^ and $ (beginning of line, end of line) in regex searches. It
    seems that these characters match the beginning of the file, not
    the beginning of the various lines in the file. I would expect it
    to work the other way around. A search like:
    (^.)
    should match every line in the file, so that a find/replace
    could be performed at the beginning of each line, like this:
    HELLO$1
    which would add 'HELLO' at the start of each line in the
    file.
    Instead, this action only matches the first character of the
    file, sticks 'HELLO' in front of it, and then quits (or moves on to
    the next file). The endline character $ behaves in a similar
    fashion, matching only the end of the file, not the end of each
    line.
    I've searched, and all the literature about regular
    expressions in dreamweaver seems to indicate that I'm expecting the
    correct behavior:
    www.adobe.com/devnet/dreamweaver/articles/regular_expressions_03.html
    quote:
    ^ Beginning of input or line ^T matches "T" in "This good
    earth" but not in "Uncle Tom's Cabin"
    $ End of input or line h$ matches "h" in "teach" but not in
    "teacher"
    Thanks for any insight, folks.

    Hi Winston,
    I am still digesting the material from the regular expression book and will take sometime to become proficient with it.
    It seems that using groupCount() to eliminate the unwanted text does not work in this case, since all the lines returned the same value. Ie 3 posted earlier. This may be because the patterns are complex and only a few were grouped together. Otherwise, could you provide an example using the string posted as opposed to a hyperthetic one. In the meantime, at least one solution have been found by defining an additional special pattern “\\A[^%].*\\Z”, before combining / intersecting both existing and the new special pattern to get the best of both world. Another approach that should also work is to evaluate the size of String.split() and only accept those lines with a minimum number of tokens.
    Anyhow, I have come a crossed another minor stumbling block in the mean time with the following line, where some hidden characters is preventing the existing pattern from reading it:
    o;?Mervan Bay 40 Boyde St 7 br t $250,000 X West Park AE
    Below is the existing regular expression that works for other lines with the same pattern but not for special hidden characters such as “o;?”:
    \\A([A-Z][a-z]*){1,2} [0-9]{0,4}/?[0-9]{0,4}-?[0-9]{0,4} ([A-Z][a-z]*){1,2} St|Rd|Av|Sq|Cl|Pl|Cr|Gr|Dr|Hwy|Pde|Wy|La [0-9] br [h|u|t] \\$\\d+,\\d+|\\$\\d*\\,\\d+,\\d+ ([A-Z][a-z]*){1,}\\ZIs it possible to come up with a regular expression to ignore them so that this line could be picked up? Would also like to know whether I could combine both the special pattern “\\A[^%].*\\Z” with existing one as opposed to using 2 separate patterns altogether?
    Many thanks,
    Jack

  • Regex to match numbers but not characters

    Hey all,
    I brain must not be working right or something but I cannot for the life of me figure out how to get a regex to match numbers, but not characters.
    e.g.
    123456
    would match, but
    123abc
    would not. Essentially what I want to do is take a string and only return a match when the string has numbers but no characters.

    No, it doesn'tYes it does.
    "123abc".matches("\\d+");
    "abc123".matches("\\d+");
    "123".matches("\\d+");
    false,false,trueExcellent example demonstrating the output of a method.
    However the suggestion above was referring to a regular expression, not a method.
    And the above regular expression does match with the following methods
    "123abc".replaceAll("\\d+", "xxx");
    "abc123".replaceAll("\\d+", "xxx");
    "123".replaceAll("\\d+", "xxx");
    The correct regular expression to match only digits is....
    ^\d+$

  • Is there a way to match all columns in a table?

    Oracle 11.1.0.7:
    Is there any way to say match all the columns of Table A with Table B? For eg:
    Table A
    id
    name
    Table B
    id
    name
    Is there a way to say match all the columns with similar column in other in a select instead of doing "where A.id = B.id and A.name = b.name"? I am trying to write a compare script to test that replication is indeed doing the right thing.

    user628400 wrote:
    If 2 columns have null values does it match that too? I'll run some tests.It does
    SQL> ed
    Wrote file afiedt.buf
      1  with a as (select 1 col1, null col2 from dual
      2             union all
      3             select 2 col1, null col2 from dual
      4             union all
      5             select null, null from dual),
      6       b as (select 1, null from dual
      7             union all
      8             select null, null from dual)
      9  select *
    10    from a
    11  minus
    12  select *
    13*   from b
    SQL> /
          COL1 C
             2
    While I was doing the comparision I found that if column x in Table A has "null" and same column x in table B has "null" and if I do "where A.x = B.x" then it doesn't return the row. I am not sure why. Does "minus" work the same way?That's because NULL will never equal any value (including NULL) and NULL will never not equal any value (including NULL). That is
    NULL = 1 is unknown (which maps to false)
    NULL = NULL is unknown
    NULL != 1 is unknown
    NULL != NULL is unknown
    If you want to compare columns that may have NULL values, you need to use IS NULL and IS NOT NULL or use the NVL function to map NULL values to a non-NULL but impossible value, i.e.
    WHERE (a.x = b.x OR
            (a.x is null and b.x is null))or
    WHERE nvl(a.x,-17) = nvl(b.x,-17)assuming that -17 is not a valid value for either a.x or b.x
    Justin

  • Regex to match everything before an underscore

    Hi,
    I am trying to create a regular expression to match part of a file name into a variable but I can't seem to get it to work correctly.
    Here is a sample from gci:
    SERVERNAMEAPPUPP01_Baseline20140220.blg
    SERVERNAMEWWSCOOE3_Baseline20140220.blg
    SERVERNAMEWWSWEB5_Baseline20140220.blg
    SERVERNAMEPNWEBWW01_Baseline20140220.blg
    SERVERNAMEPNWEBWW02_Baseline20140220.blg
    SERVERNAMEPNWEBWW03_Baseline20140220.blg
    SERVERNAMEPNWEBWW04_Baseline20140220.blg
    SERVERNAMEPNWEBWW05_Baseline20140220.blg
    SERVERNAMEPNWEBWW06_Baseline20140220.blg
    SERVERNAMEPNWEBWW07_Baseline20140220.blg
    SERVERNAMEPNWEBWW08_Baseline20140220.blg
    SERVERNAMEPNWEBWW11_Baseline20140220.blg
    SERVERNAMEPNWEBWW12_Baseline20140220.blg
    SERVERNAMEPNWEBWW17_Baseline.blg
    SERVERNAMEPNWEBWW17_Baseline20140220.blg
    SERVERNAMEPNWEBWW18_Baseline20140220.blg
    SERVERNAMEPNWEBWW22_Baseline20140220.blg
    SERVERNAMEPNWEBWW32_Baseline20140220.blg
    SERVERNAMEPNWEBWWI01_Baseline20140220.blg
    SERVERNAMEPNWEBWWI11_Baseline20140220.blg
    LDVWEBWAABEC01_Baseline20140220.blg
    LDVWEBWABFEC02_Baseline20140220.blg
    What I am attempting to do is match from the start of the file name to the underscore(not including the underscore). This part of the file name contains the server name.
    $files = gci E:\CollectedPerfLogs\20140220 -file -name $pattern ='/[^_]*/' foreach ($file in $files){ $file -match $regex $servername = $Matches[0] Write-Host "The server name is $servername" }
    The problem is the regexisn't matching even though
    I verified it in an online regex tester. I would appreciate any assistance in figuring out why this isn't working.

    What's in your $regex variable? That wasn't included in the code you posted. You've also mashed everything onto a single line, which makes it hard to read.
    Anyhow, this value for $regex should work with the rest of your code intact:
    $regex = '^[^_]+'

  • Match-any or Match All For Class-map On Nexus?

      I have an access-list MANAGEMENT
            permit udp any eq snmp any
            permit udp any any eq snmp
            permit tcp any any eq telnet
            permit tcp any eq telnet any
           permit tcp any any eq 22
           permit tcp any eq 22 any
    My question does it matter if I use a match-any or match-all. I want to match anything in the access-list to classify the traffic correctly
     class-map type qos match-any MANAGEMENT
                match access-group name MANAGEMENT
    Or
    class-map type qos match-all MANAGEMENT
                match access-group name MANAGEMENT
    I understand a match-any is an or and a match-all is an and function. Does this apply to an access-list for  a class-map?
    Thanks

    It applies to match statements within the class map. In your case, you're only using one match statement, so there will be no difference between match-all and match-any, no matter how many entries are in the ACL. If your class map had two different ACLs in two different match statements , then the and/or logic of match-all and match-any would come into play.

  • 3850 QoS class-map match-all?

    I would like to create a QoS marking policy that re-marks packet to CS5 if the inbound traffic is SIP *and* if it is marked CS3 when it comes in.  I would have expected the configuration listed below will work.  I only found out when I tried to apply the config that, unlike other IOS devices, "class-map match-all" does not exist in 3850 3.3.x code.  It can only do "class-map match-any" Can anyone suggest a work-around config for 3850 to achieve the same end result?
    ip   access-list extended ACL-QOS-SIP
    permit tcp any range 5060 5061 any
    permit tcp any any range 5060 5061
    ip   access-list extended ACL-QOS-CS3
    permit ip any any dscp cs3
    class-map   match-all CM-QOS-CS5
      match access-group name ACL-QOS-CS3
      match access-group name ACL-QOS-SIP
    policy-map   PM-QOS-MARKING
    class CM-QOS-CS5
         set ip dscp cs5
    Any suggestions would be appreciated.

    jlkeys,  below is configuration I ended up using to resolve the issue:
    ip access-list extended ACL-QOS-SIP
     permit tcp any range 5060 5061 any dscp cs3
    class-map match-any CM-QOS-CS5
      match access-group name ACL-QOS-SIP
    policy-map   PM-QOS-MARKING
     class CM-QOS-CS5
       set ip dscp cs5

  • Help with regex pattern matching.

    Hi everyone
    I am trying to write a regex that will extract each of the links from a piece of HTML code. The sample piece of HTML is as follows:
    <td class="content" valign="top">
         <!-- BODY CONTENT -->
    <script language="JavaScript"
    src="http://chat.livechatinc.net/licence/1023687/script.cgi?lang=en&groups=0"></script>
    <a href="makeReservation.html">Making a reservation</a><br/>
    <a href="changeAccount.html">Changing my account</a><br/>
    <a href="viewBooking.html">Viewing my bookings</a><br/>I am interested in extracting each link and the corrresponding text for that link into groups.
    So far I have the following regex <td class="content" valign="top">.*?<a href="(.*?)">(.*?)</a><br>However this regex only matches the first line in the block of links, but I need to match each line in the block of links.
    Any ideas? Any suggestions are appeciated as always.
    Thanks.

    Hi sabre,
    thanks for the reply.
    I am already using a while loop with matcher.find(), but it still only returns the first link based on my regex.
    the code is as follows.
    private static final Pattern MENU_ITEM_PATTERN = compilePattern("<td class=\"content\" valign=\"top\">.*?<a href=\"(.*?)\">(.*?)</a><br>");
    private LinkedHashMap<String,String> findHelpLinks(String body) {
        LinkedHashMap<String, String> helpLinks = new LinkedHashMap<String,String>();
        String link;
        String linkText;
          Matcher matcher = MENU_ITEM_PATTERN.matcher(body);
          while(matcher.find()){
            link = matcher.group(1);
            linkText = matcher.group(2);
            if(link != null && linkText != null){
              helpLinks.put(link,linkText);
        return helpLinks;
    private static Pattern compilePattern(String pattern) {
        return Pattern.compile(pattern, Pattern.DOTALL + Pattern.MULTILINE
            + Pattern.CASE_INSENSITIVE);
      }Any ideas?

  • When I downloaded I tunes and bought Match all 3 of my computers synced. Now I download a song from Amazon into Media player or burn a cd and they are not syncing with the other computers. I update match and have my boxes checked in preferences.

    When I originally downloaded i tunes and bought match all 3 of my computers synced. Now when I download a song from Amazon into media or burn a cd into media they are not syncing. I go in and update match thinking that might work, it hasn't. I have all of my boxes checked in preferences on all 3 computers.

    Yes i've tried all of that. I've turned it all the way on and off and erased all of my music and put it back on and nothing works. And with the breaking up CDs and putting into compilation categories i have already fixed all of that stuff. It's fine it just doesn't show up in the list of artists. I can find the album in the songs category and the albums category it's just it doesn't show tha name of the artist. All of the other albums that i downloaded before i updated my itunes to th most recent update are fine. It's just the two that i downloaded afterwards. Thanks for trying though.

  • How do you get java regex to match two different pattern

    Hi,
    I am having trouble getting getting java regex to match two pattern: "unknown host" or "100%".
    Here is a snippet of my code:
    try{
    Process child = Runtime.getRuntime().exec(" perl c:\\ping.pl");
    BufferedReader in = new BufferedReader( new InputStreamReader( child.getInputStream() ));
    String patternStr = "(unknown host | 100 %)";
    Pattern pattern = Pattern.compile(patternStr);
    Matcher matcher = pattern.matcher(" ");
    String line = null;
    while ( (line = in.readLine()) != null){
    System.out.println(line);
    matcher.reset(line);
    if (matcher.find())
    // line matches throws pattern
    System.out.println("match string");
    else
    System.out.println("no matches");
    I thought the "|" means OR but somehow it is not working.
    kirk123

    Hi,
    with String patternStr = "(unknown host | 100 %)"; you are looking
    for the strings "unknown host " OR " 100 %", with the spaces after host and before 100.
    Try "(unknown host|100 %)"
    hope, this will help you

  • What IOS version has the 'match-all' 'match-any' key words

    in the Class-map statements? I'm running 12.1(13) and those key words are not available.
    Another question - with the 12.1(13) that doesn't have those key words, what is the default behavior? Is it match-all?

    This option works on 12.2 and you can see the smaple configuration in the below link, and 12.1(13) has bugs in policy routing - CSCdx80891, CSCdy49411. This is the issue you are facing.
    http://www.cisco.com/en/US/products/sw/iosswrel/ps1835/products_configuration_guide_chapter09186a00800bd909.html#1020627

  • All track #5s begin at 5:50

    My 2nd gen iPod touch began this error after the last update although I never discovered it until recently since I had not been using the device regularly until now. This issue had not occurred prior to whatever was the last software update to the iPod touch.
    All fifth tracks begin at 5:50 into the song. There is no way of stopping this. You cannot start to track 6 and back up, it just stalls and sometimes the Music app will close. When track 4 concludes, then track 5 will automatically start at 5:50 or just be skipped if the track is shorter than that.
    No amount of restoring the iPod touch appears to rectify this error. Any advice or thoughts are helpful. I am also submitting this as a bug to Apple. Thanks.

    So, apparently it takes 4 complete restores for the problem to go away! After the fourth time of completely restoring the iPod touch fresh (not using a system backup to bring it back to life), it suddenly eliminates this feature of playing all 5th tracks beginning at 5:50.
    This is the strangest thing that I have ever encountered with Apple but it is now apparently solved.
    If, for some reason, all of my sixth tracks begin playing at 6:06, then I'll let everyone know. But until then, crisis averted. Thank you Apple for whatever magic happened to get rid of this problem.

  • ADF ViewCriteria 'Match All' or 'Match Any'

    Hi,
    i can't find method (using backing bean or ViewImpl.java - getViewCriteria()...)to get information whether the user has selected 'Match All' or 'Match Any'.
    Thank you,
    Andreja

    Try the following to check if it is allowed to set "Match All" or "Match Any":
    ViewCriteria vc = ...;
    Boolean value = vc.getProperty("allowConjunctionOverride");Try the following to check if it was set "Match All" or "Match Any":
    ViewCriteria vc = ...;
    int value = vc.getConjunction();Dimitar

  • Writing all the rows in one line but cannot write more than 32767 character

    Dear All,
    i am trying to write the column of a table to a file with the '||' seperators. i want to write all the rows in one line of the file.
    for E.g
    Column1 Column2
    A B
    C D
    in the file the output needs to be gone like
    A||B||C||D
    but after 32767 character it gives a write error. could please someone let me know what is wrong with my function below or how can i write more than 32767 character in one one.
    CREATE OR REPLACE FUNCTION CORP_IB_DUMP_FILE (
    P_QUERY IN VARCHAR2,
    P_SEPARATOR IN VARCHAR2 DEFAULT '',
    P_DIR IN VARCHAR2,
    P_FILENAME IN VARCHAR2
    RETURN NUMBER AUTHID CURRENT_USER
    IS
    L_OUTPUT UTL_FILE.FILE_TYPE;
    L_THECURSOR INTEGER DEFAULT DBMS_SQL.OPEN_CURSOR;
    L_THECURSOR2 INTEGER DEFAULT DBMS_SQL.OPEN_CURSOR;
    L_COLUMNVALUE VARCHAR2 (4000);
    L_STATUS INTEGER;
    L_COLCNT NUMBER DEFAULT 0;
    L_SEPARATOR VARCHAR2 (10) DEFAULT '';
    L_CNT NUMBER DEFAULT 0;
    BEGIN
    L_OUTPUT := UTL_FILE.FOPEN (P_DIR, P_FILENAME, 'w', 32767);
    DBMS_SQL.PARSE (L_THECURSOR, P_QUERY, DBMS_SQL.NATIVE);
    FOR I IN 1 .. 255
    LOOP
    BEGIN
    DBMS_SQL.DEFINE_COLUMN (L_THECURSOR, I, L_COLUMNVALUE, 4000);
    L_COLCNT := I;
    EXCEPTION
    WHEN OTHERS
    THEN
    IF (SQLCODE = -1007)
    THEN
    EXIT;
    ELSE
    RAISE;
    END IF;
    END;
    END LOOP;
    DBMS_SQL.DEFINE_COLUMN (L_THECURSOR, 1, L_COLUMNVALUE, 4000);
    L_STATUS := DBMS_SQL.EXECUTE (L_THECURSOR);
    LOOP
    EXIT WHEN (DBMS_SQL.FETCH_ROWS (L_THECURSOR) <= 0);
    L_SEPARATOR := '';
    FOR I IN 1 .. L_COLCNT
    LOOP
    DBMS_SQL.COLUMN_VALUE (L_THECURSOR, I, L_COLUMNVALUE);
    UTL_FILE.PUT (L_OUTPUT, L_SEPARATOR || L_COLUMNVALUE);
    L_SEPARATOR := P_SEPARATOR;
    UTL_FILE.FFLUSH (L_OUTPUT);
    END LOOP;
    UTL_FILE.FFLUSH (L_OUTPUT);
    L_CNT := L_CNT + 1;
    END LOOP;
    DBMS_SQL.CLOSE_CURSOR (L_THECURSOR);
    UTL_FILE.FCLOSE (L_OUTPUT);
    RETURN L_CNT;
    END CORP_IB_DUMP_FILE;
    /

    user577300 wrote:
    Dear All,
    i am trying to write the column of a table to a file with the '||' seperators. i want to write all the rows in one line of the file.
    for E.g
    Column1 Column2
    A B
    C D
    in the file the output needs to be gone like
    A||B||C||D
    but after 32767 character it gives a write error. could please someone let me know what is wrong with my function below or how can i write more than 32767 character in one one.
    CREATE OR REPLACE FUNCTION CORP_IB_DUMP_FILE (
    P_QUERY IN VARCHAR2,
    P_SEPARATOR IN VARCHAR2 DEFAULT '',
    P_DIR IN VARCHAR2,
    P_FILENAME IN VARCHAR2
    RETURN NUMBER AUTHID CURRENT_USER
    IS
    L_OUTPUT UTL_FILE.FILE_TYPE;
    L_THECURSOR INTEGER DEFAULT DBMS_SQL.OPEN_CURSOR;
    L_THECURSOR2 INTEGER DEFAULT DBMS_SQL.OPEN_CURSOR;
    L_COLUMNVALUE VARCHAR2 (4000);
    L_STATUS INTEGER;
    L_COLCNT NUMBER DEFAULT 0;
    L_SEPARATOR VARCHAR2 (10) DEFAULT '';
    L_CNT NUMBER DEFAULT 0;
    BEGIN
    L_OUTPUT := UTL_FILE.FOPEN (P_DIR, P_FILENAME, 'w', 32767);
    DBMS_SQL.PARSE (L_THECURSOR, P_QUERY, DBMS_SQL.NATIVE);
    FOR I IN 1 .. 255
    LOOP
    BEGIN
    DBMS_SQL.DEFINE_COLUMN (L_THECURSOR, I, L_COLUMNVALUE, 4000);
    L_COLCNT := I;
    EXCEPTION
    WHEN OTHERS
    THEN
    IF (SQLCODE = -1007)
    THEN
    EXIT;
    ELSE
    RAISE;
    END IF;
    END;
    END LOOP;
    DBMS_SQL.DEFINE_COLUMN (L_THECURSOR, 1, L_COLUMNVALUE, 4000);
    L_STATUS := DBMS_SQL.EXECUTE (L_THECURSOR);
    LOOP
    EXIT WHEN (DBMS_SQL.FETCH_ROWS (L_THECURSOR) <= 0);
    L_SEPARATOR := '';
    FOR I IN 1 .. L_COLCNT
    LOOP
    DBMS_SQL.COLUMN_VALUE (L_THECURSOR, I, L_COLUMNVALUE);
    UTL_FILE.PUT (L_OUTPUT, L_SEPARATOR || L_COLUMNVALUE);
    L_SEPARATOR := P_SEPARATOR;
    UTL_FILE.FFLUSH (L_OUTPUT);
    END LOOP;
    UTL_FILE.FFLUSH (L_OUTPUT);
    L_CNT := L_CNT + 1;
    END LOOP;
    DBMS_SQL.CLOSE_CURSOR (L_THECURSOR);
    UTL_FILE.FCLOSE (L_OUTPUT);
    RETURN L_CNT;
    END CORP_IB_DUMP_FILE;
    /Check your logic very carefully. You are using UTL_FILE.PUT() which should not automatically put end-of-line characters i n your file but you are reassigning l_seperator with p_seprator after the first time.
    What value are you pasising in as p_seperator?
    UTL_FILE.PUT() should allow you to write a string of bytes without newlines as long as its arguments are less than 32K, and you can control when the newlines get written. If your arguments are > 32K can you split them up without writing the newlines until you need to do so? Try something like (untested)
    --         UTL_FILE.PUT (L_OUTPUT, L_SEPARATOR || L_COLUMNVALUE);
               UTL_FILE.PUT (L_OUTPUT, substr(L_SEPARATOR || L_COLUMNVALUE,1,32767));
               UTL_FILE.PUT (L_OUTPUT, substr(L_SEPARATOR || L_COLUMNVALUE),32767*2-1,32767));Edited by: riedelme on Sep 10, 2012 6:11 AM

Maybe you are looking for

  • HOW TO GET INFORMATION ABOUT THE CLIENT MACHINE AT DATABASE LEVEL

    HOW TO GET INFORMATION ABOUT THE CLIENT MACHINE AT DATABASE LEVEL USING 10g Database and 10g Application Server we have developed an application using oracle forms 10g with oracle database 10g and Application server 10g Application uses a single Orac

  • How can i find numberedList in a text frame?

    Hi, I need to find the numberedList in a text frame. so that i have written a script. Syntax is given below. app.findTextPreferences = NothingEnum.nothing app.findTextPreferences.bulletsAndNumberingListType = app.findTextPreferences.bulletsAndNumberi

  • Email programming

    Hi folks, I have a requirement like i have to send report output as an attachment to email. I am new to this requirement. Can any body guide how to proceed... Plz do explain me the procedure clearly.. Thanks in advance. Regards, Raja.

  • Re : Third Party

    Hi     In third party order, while doing MIGO the following error is coming " Purchase order has no items " How to solve this Thanks Mani

  • Function module to create FIELD CATALOG

    I am displaying data through ALV using SET_TABLE_FOR_FIRST_DISPLAY method of class CL_GUI_ALV_GRID. is there any function module available to create the field catalog for that?? the F.M. "REUSE_ALV_FIELDCATALOG_MERGE" is giving some error for that. a