Replace or remove all single line breaks in a Blob

Hello

I want to remove/replace all new simple lines (NOT the carriage return / new line) in a BLOB.

I tried to convert the BLOB in a clob, and then replace all occurrences of new lines of simple with the function replace (for example replace (clob, 10),)
I even cut the clob into small pieces of varchar2 and tried to apply the function replace etc., but without success!

I'd be happy if someone could give me a tip how I could fix this problem.

I use
Request 4.1.0.00.32 Express on
Oracle 10g (10.2.0.4.0 - 64 bit)

Thank you
Johnny

Johnny Be Good wrote:
Hi Paul,.

the answer to your first question is simple. I use a blob instead of a clob object because I download a file (csv) using an element "Browse file".
The file is then stored in FLOWS_FILES. WWV_FLOW_FILE_OBJECTS$ (wwv_flow_files) that stores the file in a blob (blob_content) column.

What to do now is to store the contents of the BLOB to a file in a directory in order to to use as an external file.
After this, I question the external file and merge the contents into a normal table within the database.

The problem I have now is that sometimes downloaded csv files have 'broken data sets' in the way that a line (a single dataset), which was divided into
two or more rows (with a single line break at the end of each line instead of a carriagereturn/linefeed to the normal lines).
Sometimes, when the lines matching/data sets contain a very large text (e.g. 3000 characters) in a single column and MS excel (the tool used to record the original excel in csv file) can not handle this long texts of a column and breaks the content of a line into multiple lines in a cell.

However, I need to "Break" the broken data sets in the blob downloaded by removing (or replace) single line breaks, which are an indication of a split data set.

In view of this process. I converted to CLOB BLOB when the file is extracted from APEX_APPLICATION_FILES, remove the EPA of the problem, and then write in the file system as a CLOB.

I tried to do by converting the BLOB in a clob, for example with this function:

A function like this is reinventing the wheel. 10g comes with dbms_lob.convertToClob (see above).

And after conversion, trying to replace all the occurrences of single line within this clob breaks, for example with this code:

l_clob := replaceClob(l_clob,chr(10),' ');

Who will replace all the LFs, whether or not they are in CR/LF pairs. Use regexp_replace/regular expressions to exclude EPA following a CR (see above).

"Without success" means, that the line breaks have not been replaced. I tried several ways as delete (replace without a third parameter and the corresponding function), replacement (for example with a white) etc. !

I even tried to apply the function of standard replacement for varchars on a clob that I read somewhere that it is supported in 10g and apex 4.1 but with the same result.

I think that you have been making life difficult for yourself. Everything that seems to involve more (ineffective) writing code as necessary. Everything you need is built into 10g (it seems that you could use the obsolete references?)

I hope I could explain the question a bit better now and would appreciate it if you had a starting point for me.

Should have what you need in the above examples.

Tags: Database

Similar Questions

  • I still have not found "help" to tell me how to remove all the lines and columns beyond those needed for my spreadsheet.

    I used several worksheets.  More allows me to specify the rows/columns and then delete them.  This is to remove all the lines/columns beyond those set up and formatted for my spreadsheet.   I tried many ways to remove all additional lines/columns, but without success.  I even took the time to scroll down/on to highlight all the unnecessary lines and columns, but they do not remove it.
    Any suggestions?  I used spreadsheets most allow me to specify the number of rows/columns for my worksheet

    You can ask your question in the office | Excel Forum because it is not really a problem of Windows XP performance and maintenance.

    Office | Excel

    http://answers.Microsoft.com/en-us/Office/Forum/Excel

    Also, providing specific information may help to get a faster response or better, such as the version of Office or Excel? version of Windows XP? Home, Pro, 32-bit or 64-bit.

    I hope this helps.

  • remove the editfield line break

    Hi I have a newline removal of difficulty of editfield. The situation is that I have editfield and the user inserts the body of the text.

    When the user clicks on a button, I want all the characters than insert user to show online with no spacing or no line breaks. I used StringUtilities.removeChar (String, "") to remove the empty spaces, but I don't know how to remove line breaks ("feed").

    Please help and thank you!

    Thanks for the suggestion, but I found a simple way using two Editifields!

  • How to remove the default line break when you export in XML format?

    Hello

    I'm using FDK 11 to convert a FrameMaker to XML file. Basic example as in the "guide structured Import/Export API Programmer" works very well. But all my files frame long paragraphs which, then the conversion is a line break after a length that appear to be the default. Hereby, the length of the XML and the readability becomes tedious. Here is the snapshot of the transformation and the piece of code used. Please let me know if there is a function that allows to eliminate this default behavior.

    #include "futils.h".

    extern VoidT Structured_ApiEmergency ((VoidT)) FARGS;

    extern VoidT Structured_ApiInitialize ((init IntT)) FARGS;

    extern VoidT Structured_ApiCommand ((command IntT)) FARGS;

    extern VoidT Structured_ApiNotify FARGS ((IntT notification,

    F_ObjHandleT docId, sparm StringT,

    IntT iparm));

    VoidT F_ApiEmergency() {}

    Structured_ApiEmergency();

    }

    VoidT F_ApiInitialize (IntT init) {}

    Structured_ApiInitialize (init);

    }

    VoidT F_ApiCommand (IntT command) {}

    Structured_ApiCommand (Command);

    }

    VoidT F_ApiNotify (IntT notification,

    F_ObjHandleT docId, StringT, IntT iparm sparm) {}

    Structured_ApiNotify (notification, docId, sparm, iparm);

    }

    Export.jpg

    Thank you

    Vincent

    [Message moved from General Discussion by moderator]

    Hi Vincent,.

    You use a structured application? If so, you might try reading/writing as a rule:

    writer

    {

    line break is 1000 characters;

    }

    .. .or whatever length you deem appropriate.

    Russ

  • Button to remove all empty lines

    I am trying to create an interactive form that has a button that adds lines for the user to enter questions and another to add follow-ups to the authorities. There are 3 different sets of these. However, we do not want to add a button to remove all lines, in order to allow the accidental deletion of data already entered.  I would like to create a button that deletes all empty lines, including all subforms.  Either that, or to save the document, would be deleted all empty lines - depending on what would be easier. Help, please!  It seems that this will be a complicated task and I'm not well versed in LiveCycle to figure this on my own.

    Thank you!

    In the object > range of liaison. I've included a screenshot on the forum.

    Niall

  • question of dynamic text single line break

    I have a simple file that loads text dynamically inside a symbol... How can I put line breaks? My code is below. If I leave the text as it is, it jumps a line between the two.

    (actionscript in the flash file)

    loadVariables ("pacific.txt", "_root.pacific");

    txt file

    data = CANADIAN PACIFIC DISTRICT
    Steve Foster
    [email protected]
    1-877-850-2664
    Cell phone: 250-667-4827

    Thank you

    Frank

    NOT

    / n

    use:

    \n

  • Line breaks ignored when using text HTML CSS and embedded fonts

    Someone at - it find it.
    When you use a style sheet with html text in a dynamic textfield with embedded fonts line breaks are ignored. It's as if TextField.condenseWhite is set to true. Essentially the < p > tags are treated as a < br / > tag.

    If I do not incorporate fonts, it works fine. Another weird thing is that if I add an empty paragraph < p > < / p > between the first two paragraphs it makes any following paragraph behave correctly. for example

    < p > first text paragraph here < /p >
    < p > second text paragraph here < /p >
    < p > third text of paragraph here < /p >

    poster as if there are < br / > between each of them.

    But

    < p > first text paragraph here < /p >
    < p > < / p >
    < p > second text paragraph here < /p >
    < p > third text of paragraph here < /p >

    behaves correctly even for the third paragraph.

    Here is the code that I work with (by using XML as I am filling dynamic textfield to XML)

    any help much appreciated

    UPDATE:
    After reading http://www.kirupa.com/forum/showthread.php?t=307326
    I tried the same experiment using a TF designed in the IDE, the results for each, although the TextFields are essentially the same are totally different.

    Updated CODE accordingly - just need TF on stage, called "ideTextField" with the font "Arial".



    Ok
    I gave up to play with style sheets, try display: block, inline, different ways to format the XML data, in play with XML.ignoreWhiteSpace and XML.prettyPrinting etc.

    I went down the road of encodeURI, using a regular expression to remove all tabs, line breaks and the transport returns. This now gives consistent results for all situations, even incorporated and any fonts embedded.

    for example
    _TEXT:string = TEXT FROM XML, HTML TEXT etc.

    var st:String = encodeURI (_text);

    var model: RegExp = /(%09) + | (0 %) + | (0 % D) + / g ;

    St = st.replace (model, "");
    St = decodeURI (st);

    YOUTEXTFIELD.htmlText = m;

    The

    Tags always behave like a
    Tag, but you can add an extra
    to simulate a paragraph.

    Here is the example with the updates,

    Hope this helps someone

  • FTP Dreamweaver CC2015 removes all line breaks in the php files. How can I fix this problem?

    When I upload a php file. The ftp transfer removes all line breaks and creates a continuous line of unique text. I need to download the code with all the line breaks in the original php file correctly.

    I found the problem.

    FTP of Dreamweaver CC 2015 program is not compatible with Yosemite 10.10.5 on all ftp servers.

    The new version of FileZilla (v 3.14.0) is also not consistent.

    Fetch 5.7.5 is fully compatible with Yosemite. With Fetch, I can download the files without any problems successfully.

    In their update, Fetch mentioned that the problem is not with all servers.

    I host on Unix servers with HostGator AMD Opteron processors running on an OS GNU/Linux 64 - bit.

    If you run Yosemite and ftp of Dreamweaver is ruin your line breaks, then use Fetch until Adobe can fix their problem.

  • Remove all lines except 10 random lines

    Hello

    How to remove all the lines in the JOBS table except 10 lines at random?

    Someone asked him before (not here...): http://stackoverflow.com/questions/10820105/t-sql-delete-except-top-1

    but I didn't get the answer, and I don't think it will work in PL/SQL.

    If the answer to StackOverflow's works in PL/SQL, I will be happy if someone explains me with a better example.

    If the answer to StackOverflow does'nt work in PL/SQL, I will be happy if somebody give me an example.

    Thank you!

    Try this

    delete from jobs where rowid not in (select rowid from jobs where rownum <= 10)
    
  • Remove line breaks

    Hi guys,.

    I'm not very good at using the GREP command or text to FIND. How can I delete a lot of line breaks but keep the dash?

    space1.png

    I want a paragraph on the right to resemble the one on the left. I did the research comand ^ p and then change space, but which will remove the two line breaks and paragraph eventually United as this image

    space 2.png

    Any info on that?

    Thank you!

    S

    If your goal is to remove empty paragraphs, you can use the change to find predefined query (multiple back to return only in English), or run the sample FindChangeByList script which will also fix other things as mutiple spaces. and a return from space.

  • FF sometimes emits malformed requests (Accept-Language contains a line break) == &gt; error 400

    A few days ago, I started to get 400 errors on some sites (not all). I would get errors of

    -snip-
    Bad request

    Your browser has requested that this server could not understand.
    Request header field is missing ':' separator.

    q=0.8,en-CA-x-Rogers;q=0.8,en-IE;q=0.7,it-it;q=0.7,it;q=0.6,es-ES;q=0.6,ES;q=0.

    -snip-

    I discovered that FF was sending a malformed request - notice how the Accept-language header is broken by a single line break. (I have fact/r and / n visible.)

    -snip-
    GET / HTTP/1.1\r\n
    Host: www.thestar.com\r\n
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; RV:17.0) Gecko/20100101 Firefox/17.0\r\n
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n
    Accept-Language: en-US,en,en-ca;q=0.9,en-gb;q=0.9,fr-FR;q=0.9,fr;q=0.8,fr-ca\n

    q=0.8,en-CA-x-rogers;q=0.8,en-IE;q=0.7,it-IT;q=0.7,it;q=0.6,es-ES;q=0.6,es;q=0.6,ko-KR;q=0.5,ko;q=0.5,is-IS;q=0.5,is;q=0.4,de-DE;q=0.4,de;q=0.4,cs-CZ;q=0.3,cs;q=0.3,ru-RU;q=0.3,ru;q=0.2,ca-AD;q=0.2,ca;q=0.1,en-AU;q=0.1,pl-PL;q=0.1 pl;q=0.0\r\n

    Accept-Encoding: gzip, deflate\r\n
    Connection: keep-alive\r\n
    \r\n
    -snip-

    I tried the suggested steps: empty the cache/cookies/active connections/off line data Web site closed FF, deleted the file cookies.sqlite, rebooted. The problem persists. The only clue is the Accept-Language malformed header.

    It's not fun to have a paralyzed FF. Thanks for your help.

    Must you really all these languages?

    Tools > Options > content: languages-> choose

  • How to keep line breaks in CSV, TXT doc then merge the data in CC?

    Hey,.

    There is a thread for this question, answered in 2009, then in 2014 (that wasn't there is still no ideal integrated solution):

    https://forums.Adobe.com/thread/415563?start=0 & tstart = 0

    But I was wondering if Indesign CC2015 made no progress in this regard...?

    Thank you

    Vanessa

    In simple, no words. With the exception of the variable QR codes, merge data has remained the same since that post.

    The current solution of:

    • put a delimiter in the source file, such as
      or | to represent the newline; then
    • Merge into a new indesign file and use find/replace to replace the separator for a line break

    Is always the simplest solution with the data merge.

    Data merge isn't the only way to import variable data. XML is another way, but the learning curve is steep. The rewards are worthwhile, but prepare to invest some many hours in learning!

    Otherwise, perhaps consider a third party plug-in which may be more appropriate than merge data.

    Rest assured, you are not alone. All I can suggest is to go to the feature request/Bug Report Form and the application as a feature request.

    Colin

  • CFFILE - reading text file and maintenance of line breaks

    I am using cffile to read a text document, then add then display the content of the text document in a file .xml for an atom feed. Everything works fine, but it seems that cffile is stripping on the line breaks in the original file so that the contents of the variable which is save has more no line breaks. Is there an attribute that I'm missing that will control this behavior or I have to go about it in different ways. Thanks in advance for any idea on this issue.

    Why do you say that line breaks are removed?

    If you just say that because when you look at the results in your browser.  Recall that the HTML standard ignores all the line breaks and most other white space.  A quick overview of the source will tell you if the line breaks are there or not.  Using the HTML code

    ...
    Tags is the right way to tell a browser not not to ignore white space in the source.

    But it is possible that somewhere along the process of conversion of text file to XML data line breaks are stripped.  But then, we would need to see significant process pieces for a chance to help you.

  • HTMLEditFormat/HTMLCodeFormat with line breaks and newline

    I seeks to some user entered the information on the screen and hit my a problem of output formatting. If I use HTMLEditFormat(), I lose all the line breaks, but that Word wraps nicely. If I use HTMLCodeFormat(), I get line breaks, but the text isn't as word wrap, making some really large screens, even if I put the information in a table with specific to a specific width defined. Is there a way to get the best of both worlds? I need to be able to keep line breaks (sometimes they seized lists or have several paragraphs) but want to word wrap too so that it is easy to read without scrolling sideways. Any ideas?

    Thanks for your suggestions. Given that the information is entered by external users and displayed to the public, I use HTMLEditFormat and HTMLCodeFormat to help prevent script attacks, so don't really want to drop them altogether. However, I discover after playing with the suggestion listed here, it will work: #Replace (HTMLEditFormat (mytext), chr (10),')
    (', 'all') #.

    HTMLEditFormat gets rid of the carriage return character, but not the line supply, so it is possible to replace line breaks with
    to create the desired effect.

    Thanks for your suggestions.

  • Automatically convert soft line breaks in the text box to hard breaks

    I have the design of textbooks and convert to ePub recomposable, broke up. These ePub files get formatted then can be used interchangeably on the printed text. A book that I am currently in conversion is a literature book where there are lines of text with the overall line numbers so that teachers can quickly refer to a specific section of the text.

    All the line breaks in the ID file are defined just by the edge of the text box. So the text box change sizes, all line breaks would also change. Isn't a problem until you need to keep these online breeze in recomposable text and add up the numbers in.


    What I'm looking for is a way to insert automatically the line breaks in these LONG sections of text in the right places. Does anyone have any ideas on how to do that?

    Thank you!

    Select a text box and run this script. He puts a soft return at the end of each line that doesn't have a carriage return. For more information on the installation and use of this script see http://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-o r-blog - post.php .

    Written by Skemicle

    If (parseFloat (app.version)<>

    main();

    on the other

    app.doScript (principal, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "add end of line returns");

    main() {} function

    lines of the var = app.selection [0].parentStory.lines;

    for (i = 0; i<>

    If (rows [i] .characters [-1] .silence! = "\r") {}

    lines [i] .characters [-1] .silence = "\n";

    }

    }

    }

Maybe you are looking for