Search/replace in huge files without line breaks

i need to search and replace in huge XML files not containing line breaks. i cannot load them to memory as a whole because of size and cannot write a simple GrepReader because the $%��*" legacy system exporting the files does not do line breaking
plz help

P.S.
the files are looking similar to XML, they are not XML at all - thats the original reason i have to modify them, no parser will accept them. aka: plz do not suggest SAX-parsing...

Similar Messages

  • Search & Replace function in Files?

    Does there exist a "Search & Replace String" function for Files IO? ...preferable RandomAccessFile.
    Or do I have to make my own parser from scratch.
    Anyone know of free code that exists somewhere? This seems like a function that someone must have made at least or has a use for.
    Thanks for any! :)
    rasmasyean

    The JDeveloper Editor provides Search & Replace functionality for files.
    What I typically do is
    Select menu: Search | Search Source Path...
    Enter Search String and Change Source path
    and other fields and press Start
    Then the Navigator displays a Search tab which lists all files with the matching string.
    Double click on first file in navigator and
    select menu Search | Replace
    In this dialog enter your search, replace, and other options-
    In the Options, If you do not want to be prompted, do not check the Prompt on replace option.
    Select the Scope of Global
    Selectg the Origin of Entire
    When you are ready press the Multiple button to make multiple replacements.
    When you are done with this file,
    Press Ctrl-S to Save the file
    Press Ctrl-F4 to close the window
    Double click on the Next File
    Press Ctrl-R to invoke the Search | Replace dialog.
    You should not need to change any options.
    Press Alt-M to select the Multiple Button!
    While this may seem more complex then a simple Sed / Perl / Python script, it is more controllable, flexible and user friendly.
    Besides, you may learn a few JDeveloper tricks.
    Good Luck,
    -John

  • How to replace a native file without deleting it?

    I was wondering if anyone can let me know to replace a native file without deleting it.
    Thanks
    Kalyan

    John
    Thanks for replying. Ok checking in a new revision is not an option. This document belongs to a plant. They have two revisions. One revision is released and other in Genwww. We have identified the issue which has a problem which has links that do not work. So people at plant do not want to check in a new revision as it goes through a 3 step workflow and it involves approvals etc. So best option here is to replace a native file and have the same approvers as what were there for revision 1. Would batch import work? If it does, how would it?
    Thanks
    Chetan

  • How to extract compiled stored procedure without line break for long statement

    After I compiled stored procedure which contains long statement, the statement would cut into 2 rows into dba_source.
    However, when I extract the codes from dba_source table, the source couldn't be compiled successfully because of
    the broken lines.
    For example, the following statement would be broken into 2 rows like this:
    (line 1) gv_Message := 'Interface Description: Interface with Training '|| 'and Development Intran
    (line 2) et (Evaluation Statistic Details)';

    That's very strange. What did you originally compile it with (sql*plus, toad, etc...)? I was able to compile a procedure with the maximum line length (2499 characters see error SP2-0027) and there is no split. Is the procedure in a VALID state with that line break? Honestly, this seems very odd, possibly even a bug here somewhere.
    Richard

  • ALV Export to excel (spreadsheet) without line break

    my ALV report contains 76 columns, if i try to download it in an excel sheel its not getting displayed in correct format.
    Few columns are automatically displayed in the second row and also all my values are getting collapsed due to this display.
    In the print preview also i am getting the same problem.
    Is there any column limit in ALV display or i can make it to get display correctly as it is in the exact output.
    ALv reports contain various options such as sort,filter,print preview, download to excel etc....in this if i use the download to excel option in the excel sheet its getting displayed as col1,col2,col3.......col54
    col55,col56.................col75
    but i need the output to be in a single line such as col1,col2,col3,.........col75
    I do not want the line break.
    Edited by: Suhas Khengle on Oct 1, 2008 11:50 AM

    Hi Suhas,
    Can you tell me what was the solution for your issue? I'm also facing same issue
    Regards,
    Siva

  • Is it possible generate file with line break without add one character?

    Hi all,
    my problem is when i generate a file .txt from ABAP as below:
    "===>start of code<===
    REPORT  zteste_bm.
    TYPES: BEGIN OF ty_line,
             v_char(100) TYPE c,
           END OF ty_line.
    DATA: v_it_final type table of ty_line with header line,
          wa_line type ty_line.
    wa_line-v_char = 'line 1 with 24 positions#line 2 with 24 positions#line 3 with 24 positions'.
    REPLACE ALL OCCURRENCES OF '#' IN wa_line-v_char WITH cl_abap_char_utilities=>cr_lf.
    APPEND wa_line to v_it_final.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename = 'c:     emp     este.txt'
        filetype = 'ASC'
      TABLES
        data_tab = v_it_final.
    "===>end of code<===
    When i go to the file .txt it contains:
    line 1 with 24 positions
    line 2 with 24 positions
    line 3 with 24 positions
    and at the end of each line have a charactere in position 25 that represent CRLF (break line).
    My problem is that character 25. I don´t have it in the file .txt.
    Is it possible in ABAP use CRLF to generate the file .txt but remove them after generated? 
    Thanks!

    Bruno,
    Check the paramteres of GUI_DOWNLOAD FM and observe how the text file is when you set or reset the hightlighted input paramters.
    CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
    *   bin_filesize                    =
      filename                        = g_dskpath
    *   filetype                        = 'asc'
    *   append                          = ' '
    *   write_field_separator           = ' '
    *   header                          = '00'
    *   trunc_trailing_blanks           = ' '
      **write_lf                        = 'X'**
    *  col_select                      = ' '
    *   col_select_mask                 = ' '
    *   dat_mode                        = ' '
    *   confirm_overwrite               = ' '
    *   no_auth_check                   = ' '
    *   codepage                        = ' '
    *   ignore_cerr                     = abap_true
    *   replacement                     = '#'
    *   write_bom                       = ' '
      *trunc_trailing_blanks_eol       = 'X' " X will delete the trailing spaces*
    *   wk1_n_format                    = ' '
    *   wk1_n_size                      = ' '
    *   wk1_t_format                    = ' '
    *   wk1_t_size                      = ' '
    * importing
    *   filelength                      =
    TABLES
          data_tab                    = g_t_temp1[]
    *   fieldnames                      =
    EXCEPTIONS
    file_write_error                = 1
    no_batch                        = 2
    gui_refuse_filetransfer         = 3
    invalid_type                    = 4
    no_authority                    = 5
    unknown_error                   = 6
    header_not_allowed              = 7
    separator_not_allowed           = 8
    filesize_not_allowed            = 9
    header_too_long                 = 10
    dp_error_create                 = 11
    dp_error_send                   = 12
    dp_error_write                  = 13
    unknown_dp_error                = 14
    access_denied                   = 15
    dp_out_of_memory                = 16
    disk_full                       = 17
    dp_timeout                      = 18
    file_not_found                  = 19
    dataprovider_exception          = 20
    control_flush_error             = 21
    OTHERS                          = 22
    if sy-subrc <> 0.
    endif.

  • Is there any way to save an Adobe Acrobat X Pro pdf file as a Word file WITHOUT section breaks?

    I need to save (export) several pdf files as Word files. I need the Word files to NOT have  section breaks. Is this possible to do?  I have tried the options in the Settings (Retain flowing text; Retain page layout) but it does not help.

    Actually when thate are saved as Word what you see on the screen is what you get in Word. Where the lines end show as returns so you may have to hand remove all returns to join all parts of a sentence. So there may be  section breaks or page breaks that you have to remove.  

  • Trying to reduce HUGE file without changing size

    I have a 7.75MB (!) file. I am designing at full scale, wich is 90" x 90". Since I will later be using this file in a textile program and need to have it at full scale, I can't change it's dimensions. I have used live paint, layers, clipping masks, the works and that is part of the reason it is so big.
    Does anyone know a way to completely flatten the file? I need to reduce it's size to a most 2MB. It is so big now, that I cannot even use the "save for web" feature.

    Hello, winthur dewey.
    Expanding will most likely not reduce file size. Nevertheless, I will quickly explain how you flatten some or all of your art work.
    1. Both
    b Object>Expand
    and
    b Object>Expand Appearance
    are taking your complex objects and divide them into smaller discrete objects. Select some or all of your objects and try one of these commands to expand it.
    See http://help.adobe.com/en_US/Illustrator/13.0/help.html?content=WS714a382cdf7d304e7e07d010 0196cbc5f-62c4.html for a description about expanding (LiveDocs)
    2.
    b Object>Flatten Transparency
    is taking transparent and semi-transparent objects and turn them into bitmap, and expand other relevant, selected objects. This is actaully also the command that takes care of expanding dashed lines (because of the transparent gap between the lines). Usin fnormal expand for this, will end up with a solid line.
    See http://help.adobe.com/en_US/Illustrator/13.0/WS21A6953D-2FD5-4e21-8C4D-3410A9A09FBC.html for a description on the Transparency Flattener Options (LiveDocs)
    3. Save as Illustrator version 8 is a quick and dirty way to remove traces of the Appearance panel and transparency, since this version didn't support those features.
    See http://help.adobe.com/en_US/Illustrator/13.0/help.html?content=WS714a382cdf7d304e7e07d010 0196cbc5f-64a0.html for info about retaining transparency when saving (liveDocs)
    Important!: When dealing with transparency and effects, there eventually will be expanded to bitmap, it is important to have an eye on the command
    b Effect>Document Raster Effects Settings.
    This command will specify, what bitmap resolution your obejcts will be converted to, when expanding.
    See http://help.adobe.com/en_US/Illustrator/13.0/help.html?content=WS714a382cdf7d304e7e07d010 0196cbc5f-62c4.html for info about raster effects (liveDocs)
    All these things will flatten, or expanding your artwork. In Illustrator this will not give you smaller file size, but rather more compatible file for use in Adobe Flash, QuarkXpress and so on.
    If you need a complete bitmap image, you could try
    b File>Export
    and select some of the bitmap formats (JPG, PSD, PNG or TIFF). But 80" X 80" - I'm almost sure that is not the way to go.
    It is difficult for me to give you advice for optimization, when I do not have the document in front of me, but I hope you (one way, or the other) is getting it into the textile program :-)
    All the best
    /ockley

  • Search / Replace on other Files Types

    When do a mass search using DW CS3 and search on a directory,
    the search ignore certain file extension such as .properties. How
    can I tell the DW to search on ALL files or modify the files
    extension list that the program searches on?

    Read up on "Regular Expressions"
    "indonaught" <[email protected]> wrote in
    message
    news:ff892l$cv3$[email protected]..
    > When do a mass search using DW CS3 and search on a
    directory, the search
    > ignore
    > certain file extension such as .properties. How can I
    tell the DW to
    > search on
    > ALL files or modify the files extension list that the
    program searches on?
    >

  • ICS file - Line breaks

    Hi,
    I am sending an email with an ICS file as an attachment. Everything work fine, except that when the user opens the ICS file from their outlook, the text is displayed without a line break.
      CALL FUNCTION 'SO_OBJECT_SEND'
        EXPORTING
          object_hd_change = w_object_hd_change
          object_type      = 'RAW'
          owner            = sy-uname
        TABLES
          objcont          = message_content
          receivers        = receiver_list
          packing_list     = packing_list
          att_cont         = icsfile.
    The message contents came with the proper line breaks. But when I appended the same data into the ICS file, it came out without line breaks.
    Any comments?
    Regards
    Murali.

    Thanks for the response Venkat.
    I tried the way you have mentioned. But it doesnt reflect.
    My packaging file is as below:
    CLEAR packing_list.
      describe table icsfile lines packing_list-body_num.
      packing_list-transf_bin = 'X'.
      packing_list-head_start = 0.
      packing_list-body_start = 1.
      packing_list-head_num = 0.
      packing_list-objtp = 'ICS'.
      packing_list-objnam = 'Object name'.
      packing_list-objdes = Sale Order'.
      packing_list-objlen = packing_list-body_num * 255.
      APPEND packing_list.
    CALL FUNCTION 'SO_OBJECT_SEND'
        EXPORTING
          object_hd_change = w_object_hd_change
          object_type      = 'RAW'
          owner            = sy-uname
        TABLES
          objcont          = message_content
          receivers        = receiver_list
          packing_list     = packing_list
          att_cont         = icsfile.
    When I debugged the code, the icsfile had the below content.
    BEGIN:VCALENDAR
    PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
    VERSION:2.0
    METHOD:PUBLISH
    BEGIN:VEVENT
    ORGANIZER:MAILTO:noreply@rta
    DTSTART:20090727T110000
    DTEND:20090728T133000
    LOCATION:My location is Sydney
    TRANSP:OPAQUE
    SEQUENCE:0
    UID:2009072711000020090728133000
    DTSTAMP:20090806T130823
    DESCRIPTION:\
    This e-mail is an calendar attachment for the order confirmed yesterday via e-mail from ABC.\
    Do not reply to this e-mail, as it is automatically generated and your reply will not be received or actioned.\
    Vendor:\
    ABC Australia\
    Double click on the attachment and save for your calendar to be updated.\
    SUMMARY:Sales order has been confirmed
    PRIORITY:5
    X-MICROSOFT-CDO-IMPORTANCE:1
    CLASS:PUBLIC
    BEGIN:VALARM
    TRIGGER:-PT15M
    ACTION:DISPLAY
    DESCRIPTION:Reminder
    END:VALARM
    END:VEVENT
    END:VCALENDAR
    I can see that my empty lines are represented in the icsfile with a '/' character.
    Regards
    Murali.

  • Replacing hyphen with line break

    Hi,
    In my application I want to replace the hyphen with line break
    . I am using APEX4.0
    I am using the following javascript code:
    <html>
    <script type="text/javascript">
    function test()
    var visitorName = "<br/>";
    var myOldString = "&P2_SI.";
    var myNewString = myOldString.replace(/-/g, visitorName);
    </script>
    </html>
    I have no clue how to get it executed and make the javascript work.... can someone help?

    My application is a online test.. One of the question in Page 3 is to re-arrange the sentence that is in the form of bullets. In the text area, as there are no formatting the candidate just gives hyphen - and enters all the sentences.. so in the DB the values are saved in the single line and when we evaluate the paper, it looks odd. So we want to replace the hyphen with the line break
    , so that when evaluating the paper, the format looks good, enter of one sentence there will be a line break.
    After the candidate is done with the Page 3, clickig next button, saves the values to the DB, and the page (branching) goes to Page 4 and clicking the Previous button takes the candidate to Page 2 (branching).
    The Dynamic Action is created in the following order
    -Advanced
    -action name
    -Event ->Change
    Selection Type->Item(s)
    Item(s)->P3_S2I
    Condition-> No condition
    -Action->Execute Javscriot code
    Disabled Fire on Page Load (as the code should execure only after the candidate type something in P3_S2I text area or after the Next button is clicked.
    Code:
    <script type="text/javascript">
    var special = "<br/>";
    var myOldString = "&P3_S2I.";
    var myNewString = myOldString.replace(/-/g, special);
    document.write("<br /> " + myNewString);
    </script>
    -Selection Type -> Item(s)
    Item - P3_S2I
    -Click Create
    This time I was taken to the next page.... but at the DB level hyphen is not replaced by the line break

  • Print a line break every 9 characters

    this is a relatively simple problem but for some reason i cant figure it out.
    i have a 2 dimensional array of 9x9 ints.
    i am saving this array to a file, and want to print all 81 ints, separated by spaces, and after every 9 ints printed i want the line to break.
    this is what i have:
              for(int i = 0; i < 9; ++i)
                   for(int j = 0; j < 9; ++j)
                        outStream.print(intBoard[i][j] + " ");however, with this method it prints them without line breaks after every 9. anyone know an easy way to do this? i was thinking something along the lines of keeping a count, e.g. count++ after every time it goes through the loop, but still cant figure out how it would work.
    thanks very much in advance

    for(int i = 0; i < 9; ++i) { // <-- Added Brace
         for(int j = 0; j < 9; ++j)
              outStream.print(intBoard[i][j] + " ");
            // <-- Create break here
    } // <-- Added BraceSo, after every time the inner loop completes, you'll need to create a line break, then the loop starts over and repeats.

  • Line break in UWL

    Hi All,
    I have a workflow which gives a workitem in the UWL. I display few variables in the workitem in UWL. All the values in the variables are fine. But the problem is all the variables are coming as continuous text without line breaks. I have given HTML line-break code at the end of each line in my activity step. Line-breakk code  is working fine for the user-decision step in one of my other workflows but it is not working in this activity step.
    Where could be the problem? Please help.
    Regards,
    Sunny
    Edited by: Sunny4301 on Oct 9, 2009 4:58 AM
    Edited by: Sunny4301 on Oct 9, 2009 5:00 AM

    Hi Sunny,
    What is the application you are using to Display the workitem in UWL. Is it linked to Webdynpro, if so maintain the design as Matrix Flow Layout.
    Regards
    Narin

  • Applescript batch convert DOC to TXT with line breaks

    Hey guys, I recently got stuck at work having to convert over 1,000 DOC files to TXT files with line breaks.
    I've found online several different Applescripts that work great at converting DOC files to TXT files but I can't find one that will do the TXT files with line breaks.
    If anyone has a script that can do this I would be crazy grateful.
    Converting these one by one with Word is taking forever to do.
    Thanks for any help you can give me.

    Excuse me for a moment for speaking harshly to you.  You are causing yourself utterly unnecessary headaches by not being clear with us and not stopping to think, and it's high time you learned that that is an incorrect way to approach anything on a computer.  Consider:
    you don't know what you're doing (in the sense that you don't know what 'text with line breaks' means)
    you don't know (or at least haven't explained) why this needs to be done
    (therefore) you don't know if this needs to be done at all
    (and yet) you are doing it anyway, in a mindlessly repetitive fashion, driving yourself batty and irritating me
    At least for the time being, humans are the ones who think and computers the ones who grunt away mindlessly; try to reverse those roles and everything gets done badly and slowly. Stop, look, think, plan ahead - that's what your brain is good at if you give it a chance.
    Now, as far as I can tell from poking around the web, 'text only with line breaks' means that the document  is saved as a plain-text file, but with a carriage return linefeed combination (CR/LF) as a paragraph delimiter (this is a Windows format - unix uses a single linefeed, Macs might use a single carriage return or a single linefeed). I don't know why anyone would want that format - most software will convert that seamlessly (or at least can be told to convert that).  Are you trying to feed this into some dinosaur of a database?  At any rate, if that's what you want, this script should do it. caution, this script overwrites the original files; I suggest you make a copy of one or two files in a separate folder, and run the script on them first to check that the output works for whatever reason you're doing this:
    set baseFolder to choose folder with prompt "Choose a folder of files to process"
    tell application "Finder"
              set fileList to (every file of baseFolder whose name extension is "txt") as alias list
    end tell
    repeat with thisFile in fileList
              set itsText to read thisFile
              if (offset of (return & linefeed) in itsText) = 0 then
      -- file is not already formatted with CR/LF, so convert
                        set itsChunks to tid(itsText, {return, linefeed})
                        set itsNewText to tid(itsChunks, return & linefeed)
                        set fp to open for access thisFile with write permission
                        set eof of fp to 0
      write itsNewText to fp as text
      close access fp
              end if
    end repeat
    on tid(input, delim)
      -- handler for text items conversions
              set {oldTID, my text item delimiters} to {my text item delimiters, delim}
              if class of input is list then
                        set output to input as text
              else
                        set output to text items of input
              end if
              set my text item delimiters to oldTID
              return output
    end tid

  • Spaces/line breaks appear in Contribute

    I'm seeing extra line breaks/line feeds when browsing and
    editing a table filled with addresses and phone numbers in
    Contribute. The page appears fine in my web browsers (IE, FF &
    Opera). The page shows the line breaks in my clients Contribute and
    her web browser as well. I tried tweaking the style sheet to see if
    that would help - had no effect. Anyone else see this?

    I am seeing the same thing. My client uses Contribute 3 to
    edit/update pages. When I view source there are huge numbers of
    line breaks/line feeds in his tables. He uses WinXP, and the FTP
    function in Contribute 3. I'm browsing this forum to see if anyone
    has answers.

Maybe you are looking for

  • Performance Check - ABAP and Database color bars

    Hello everyone, When i go for the performance check of my object, i see Database in red bar and ABAP in green bar. The smaller the difference between these two bars, the better. But what does the color mean ? ( Somethimes the smaller bar is Red ) Tha

  • SQL Developer 1.5.3: SIZE honored in SET SERVEROUTPUT ON SIZE nbr ?

    I'm running some PL/SQL in SQL Developer 1.5.3 and am getting some buffer overflow error messages while using dbms_output.put_line. At the top of my script, I've put: set serveroutput on size 100000 But get these errors: ORA-20000: ORU-10027: buffer

  • Adding a Print icon to Finder windows

    I often have a list of documents in a folder I need to print.  Right now I open a Finder window, highlight all documents and go up to the menu bar and select Print.  Because I'm working on a dual monitor system (13" MB with a 27" Cinema display) it's

  • What are all the errors that can be corrected by using tran code rsrv?

    hi all,, what are all the errors that can be corrected by using tran code rsrv? can anyone list me out a list of errors that can be rectified using rsrv. And let me know the steps involved to rectify those errors using trns code rsrv. regds hari

  • Access Level restrictions

    Hi I'm currently re-developing an old site I built a few years back. Is it possible to have the User Login - Access Level restriction dependent on more than 1 database field. I'm using CS3 and the pages are PHP. Currently when a customer logs in, the