Check For Line Feed

hi again, im trying to check for a line feed character in an xml file.
im using the following code:
NodeList nodeList = ElementNode.getChildNodes();
for(int i = 0; i < nodeList.getLength(); i++) {
                    if(nodeList.item(i).getNodeValue().equals("\n")) {
                         System.out.println("Line Feed!");
                    }else
                         System.out.println(nodeList.item(i).getNodeName());
               }For some reason it never prints out "Line Feed!"
i used a transformer object to indent my xml like so,
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
               transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");so im wondering why am i not picking up the line feeds?
many thanks

ive found out what the line feed character is, but when im trying to read back in my xml,
i have it indented to 4 places (see above), this will no doubt add 4 white spaces to different parts of the xml, as well as new line characters.does it also add carriage returns?this is causing me problems reading back in.Is there any classes i can use to remove all the white spaces, new line characters etc.. so i can just get at the xml content (elements, CDATA, comments etc..)?
many thanks!

Similar Messages

  • Search for line feed characters

    Is there any way to search for line feed characters in a query? I want to ignore line feeds in a column.
    Thanks

    CHR(10) is a linefeed and CHR(13) is a carriage return.
    If you are looking for end-of-line then in UNIX it is
    CHR(10) and in Windows it is CHR(13)||CHR(10)
    You can use something like:
    SELECT REPLACE(cr_line,CHR(10),' ')
    FROM (SELECT 'This is a line'||CHR(10)||'and another' cr_line
          FROM dual)to remove linefeeds.
    TTFN
    John

  • Restrict Availability check for Line item in sales order

    Hi Folks,
         My requirement is some what different than the usual,I want to stop availability check for a particular line item,while creating sales order on a particular condition (example when quantity is changed for that line item),please suggest if there is any way to do so.
    Thanks for your valuable support.

    Hi
    we need to maintain the username of the person who has triggered this process through XI .
    I BAPI we cannot instruct the BAPI to maintain a specific username.
    that is why i am using this FM because this will allow us to maintain the change history with the username we want
    Regards
    Nikhil

  • What is escape character for for Carriage Return, Line Feed, Form Feed

    Hi
    I need to a text file which should have following characters
    Carriage Return, Line Feed, Form Feed
    How do i insert them in a string
    i know "\f" is carriage return,
    but what are characters for line feed and form feed
    Ashish

    uncle_alice wrote:
    jverd wrote:
    remus.dragos wrote:
    I forgot that it does not exist in Java. A good thing
    from my point of view.Running the following makes my computer beep.
    public class Bell {
    public static void main(String... args) {
    System.out.println("\u0007");
    Sure, sending a BEL character to the console rings the bell, but that has nothing to do with Java. Anyway, I think he meant Java doesn't support the \a escape sequence in string and char literals.
    >
    >
    >I forgot that it does not exist in Java. A good thing
    from my point of view.
    Running the following makes my computer beep.
    public class Bell {
    public static void main(String... args) {
    System.out.println("\u0007");
    } Sure, sending a BEL character to the console rings the bell, but that has nothing to do with Java. Anyway, I think he meant Java doesn't support the \a escape sequence in string and char literals.
    Ah, I thought he was saying Java doesn't support ringing the bell.

  • Regarding line feed

    Hi experts,
        I tryig for line feed in the Text file. I'm using CL_ABAP_CHAR_UTILITIES=>NEWLINE.
    example
      CONCATENATE lv_tmp_str
                  wa_notes-tdline
                  cl_abap_char_utilities=>cr_lf
             INTO lv_tmp_str.
    it showing error, the Class cl_abap_char_utilities UNKNOWN.
    how to declare, please help
    Vani

    Hi experts,
    I'm not getting solution for this
    need to disply the Tities for the PopUp screen, window screen, subscreens,... In Thai Language in Thai Login, But It was not displaying any thing including all the SAP standard screens. In debugging mode the sy-title is displaying but not in window title,
    Other than the English Login, The titles is not Displaying
    - I was checked in SE63, TRDIRT table, SNL3 transaction but of no Use
    - Options I18N has been set with Thai and font
    Any body had came across this.
    so I want to know that any Gui patches have to install , or any setting have to be done ..
    looking for your great help

  • Can't get itunes.  I get the following message when I click on either the shortcut or the program.  It says ITunes has stopped working and I can either check on line for a solution and close the program or just close the program.

    When I click on the itunes shortcut or the program  I get the following message:
    ITunes has stopped working.  My two options are:  Windows can check on line for a solution to the problem or close the program. 
    It seems that my entire library is not there.  If I sync my ipod will it add it back into my library on the computer? 
    I've even tried installing again and nothing works.  Tried the "repair" and it says that ITunes is loaded but I stil get the above error when I try to open the program.
    Thanks

    Let's try the following user tip with that one:
    iTunes for Windows 10.7.0.21: "iTunes has stopped working" error messages when playing videos, video podcasts, movies and TV shows

  • Want to know how to check for new line character in text file

    Hi All,
    I`m trying to read data from text file. However I`m not sure whether the data is in 1st line or nth line. Now I`m trying to read the text from the readline. But if text is "" and not NULL then my code fails. So I want to know how to check for new line character and go to next line to find the data. Please help.
    Thanks
    static int readandwriteFile(Logger logger,String filepath){
              BufferedWriter out = null;
              BufferedReader in = null;
              File fr = null;
              int get_count = 0;
              try     {
              if(new File(filepath).exists())
              fr= new File(filepath);
                        System.out.println("FileName: "+fr);
                   if(fr != null){
    in = new BufferedReader(new FileReader(fr));
                             String text = in.readLine();
                             if(text != null){
                             get_count = Integer.parseInt(text);
                             in.close();
                             else{
                                  get_count = 0;
         else{                    
    out = new BufferedWriter(new FileWriter(filepath));
         out.write("0");
                out.close();
                   }          //Reading of the row count file ended.
              catch(Exception e) {
                   e.printStackTrace();
              finally {
                   try{               if (in != null) {
                             in.close();
              if (out != null) {
                             out.close();
              catch(Exception e) {
                        e.printStackTrace();
              return get_count;
         }

    You are calling the readline() only once which means you are reading only the first line from the file...
    Use a loop (Do-While preferably)
    do{
    //your code
    }while(text == "")

  • How can I enable spell checking for a text box that is just one line, e.g. subject in e-mail?

    In a prior version of Firefox I found a website somewhere that told me what to do to enable spell checking for text boxes that are just one line. I got used to being able to send an e-mail with a Subject Line that didn't have a misspelling. Now it doesn't work. Please tell me how I can enable that again. I am on a Mac using Firefox 6.0.2. Thanks!

    See:
    *http://kb.mozillazine.org/Spell_checking
    *http://kb.mozillazine.org/layout.spellcheckDefault
    You can set the pref <b>layout.spellcheckDefault</b> to <i>2</i> on the <b>about:config</b> page.
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />
    *Use the Filter bar at to top of the about:config page to locate a preference more easily.
    *Preferences that have been modified show as bold (user set).
    *Preferences can be reset to the default or changed via the right-click context menu.

  • How to check plan line items for plan cost at network activity level?

    Dear all,
    How to check plan line items for plan cost at network activity level? The plan cost is done in network activity in CJ20N.
    I am not able to check using CJI4 or CJI9 report.
    Kindly advise.
    Thanks and regards,
    Jessie

    Hi Jess,
    Have you checked the navigation part which is being displayed on left hand side of report S_ALR_87013565 and S_ALR_87013533.? There you have option to check transaction currency and object currency when you double click on it.
    In case if it is not being displayed under navigation. Then you can bring them on from transaction code CJE2. For eg: Report group for S_ALR_87013533 is 12KST1C. Double click on it and it will open up to do changes in report layout and many more. There you also have options to bring on transaction currency too. Similarly, you can check for other report groups as well just by checking the report description.
    But I am not sure if suits your requirements. Wait for other experts to comment on this.
    Regards,
    Amit

  • Regarding problem with new line feed for DME file generation

    Hello Experts,
    I m facing a problem in the DME file generation.
    we want each record in the DME file should be in new line. for that we have add the new line feed character in the each row end. So in the SAP output it looks ok, But if we download that file the carriage return field is coming in the end of every row.
    can any one tell how to solve this issue.
    Please refer the below line code which i m using for new line
    DATA: GM_newline TYPE c VALUE cl_abap_char_utilities=>CR_LF
    You reply is valuable..
    Thanks,
    Suresh

    DATA: GM_newline TYPE c VALUE cl_abap_char_utilities=>newline.

  • An you tell me how to add an advanced action to the TEB so you can check for multiple lines of input

    an you tell me how to add an advanced action to the TEB so you can check for multiple lines of input? How do you add the advanced action?

    Can you elaborate your requirement?
    If you want to have a text wrapped around and enable a scroller for the same, you can achieve it by TEB properties and check the scroll bar option,
    Is this what you are looking to achieve?
    Thanks,
    Anjaneai

  • PO based invocie active check box for line items

    Hi,
    For PO based invoicing, we need the “Blank Checkbox”, which appears at Line Item Area of invoice.  We need it to be blank when  user begins invoicing entry process.  Meaning, no lines are subject to invoice, all are inactive and Users will place checkmarks for lines they want included for invoicing. It is SAP standard design.
    Do any one know how to achieve this?
    regards,
    Rahul Mandale

    HI Ujjwala,
    The setting in spro in Acct assigment,  u are talking about is GR Receipt or Invoice Receipts.
    These are not GR Based Invoice Verification.
    GR based Invoice Verification comes from either ur inforecords or vender master.
    if u check or uncheck these in spro in acct assigment, then it will comes ur Deliver Tab not ur invoice Verification Tab.
    one thing more, if u make it mutiple Acct assigment, then it will be Non Valuated G/R Based IV.
    Hope Clear U !
    REgards,
    Pardeep Malik

  • How to check for physical damage on a disk using the Command Line

    I have a startup disk that I suspect of physical damage. The symptoms is that the server (10.4.7) would "hang" randomly, about once a day. I have already changed it and restored from a backup, and now everything is fine. However just out of curiosity are there any command line utilities to do a physical surface scan of the drive, like TechTool Pro but included in Mac OS X Tiger?
    G4 Dual 1.42 Ghz   Mac OS X (10.4.6)  

    Extract from the Command Line Guide for Tiger Server:
    Checking for Disk Problems
    You can use the diskutil or fsck command (fsck_hfs for HFS volumes) to check the physical condition and file system integrity of a volume. For more information, see the related man pages.
    MacBook Pro   Mac OS X (10.4.7)  

  • I submitted my podcast and I got an email saying error, I checked with the feed validator and got this message: This feed does not validate. line 40, column 6: Undefined item element: itunes:order, how do sort this out, someone help me please.

    I submitted my podcast and I got an email saying error, I checked with the feed validator and got this message: This feed does not validate. line 40, column 6: Undefined item element: itunes:order, how do sort this out, someone help me please.

    Ignore it. 'itunes:order' is a recent addition which FeedValidator doesn't know about. If your podcast is rejected that is unlikely to be the reason. Of course as you haven't posted the feed URL nor the text of the error message I can't make any further comment.

  • Folder action to find and replace text and change line feeds

    I want to use a folder action to find and replace text and change Mac carriage returns to DOS line feeds inside text files.
    The text to be replaced is: "/Users/wim/Music/iTunes/iTunes Music/Music" (without the quotes)
    This text has to be removed (i.e. replaced by an empty string)
    The text occurs many times within each file.
    The files are playlists exported from iTunes in the M3U format (which are text files). They contain Mac carriage returns. These need to be changed to DOS line feeds.
    I have found the following two perl commands to achieve this:
    To find and replace text: perl -pi -w -e 's/THIS/THAT/g;' *.txt
    To change carriage returns to line feeds: perl -i -pe 's/\015/\015\012/g' mac-file
    I know that it's possible to make a folder action with Automator that executes a shell script.
    What I want to do is drop the exported playlists in M3U format in a folder so that the folder action will remove the right text and change the carriage returns.
    My questions are:
    Is it possible to make a folder action that executes command line commands instead of shell scripts?
    What is the correct syntax for the two commands when used in a folder action shell script? Especially, how do I escape the slashes (/) in the string to be removed?
    Thanks for your help

    Ok, I've include an applescript to run a shell command. The applesript command quoted form makes a string that will end up as a single string on the bash command line.  Depending on what you want to do, you may need multiple string on the bash command lines.  I've included some information on folder actions.
    It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on.  Here is an example.
        Author: rccharles
        For testing, run in the Script Editor.
          1) Click on the Event Log tab to see the output from the log statement
          2) Click on Run
        For running shell commands see:
        http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
    on run
        -- Write a message into the event log.
        log "  --- Starting on " & ((current date) as string) & " --- "
        --  debug lines
        set desktopPath to (path to desktop) as string
        log "desktopPath = " & desktopPath
        set unixDesktopPath to POSIX path of desktopPath
        log "unixDesktopPath = " & unixDesktopPath
        set quotedUnixDesktopPath to quoted form of unixDesktopPath
        log "quoted form is " & quotedUnixDesktopPath
        try
            set fromUnix to do shell script "ls -l  " & quotedUnixDesktopPath
            display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
        on error errMsg
            log "ls -l error..." & errMsg
        end try
    end run
    How to set up a folder action.
    1) right click on folder. click on Enable folder actions
    2) Place script in
    /Library/Scripts/Folder Actions Scripts
    3) right click on folder. click on attach folder action
    pick your script.
    Create a new folder on the desktop & try.
    You can put multiple folder actions on a folder. There are other ways of doing this.
    Here is my test script:
    on adding folder items to this_folder after receiving dropped_items
        repeat with dropped_item_ref in dropped_items
           display dialog "dropped files is " & dropped_item_ref & " on folder " & this_folder
        end repeat
    end adding folder items to
    How to  make the text into an AppleScript program.
    Start the AppleScript Editor
    /Applications/AppleScript/Script Editor.app
    In Snow Leopard it's at: /Applications/Utilities/AppleScript Editor
    Copy the script text to the Applescript editor.
    Note: The ¬ is typed as option+return.  ption+return is the Applescript line continuation characters.
    You may need to retype these characters.
    Save the text to a file as an script and do not check any of the boxes below.

Maybe you are looking for

  • How to get rid of Bing search in URL?

    I like to visit my frequently accessed webpages by beginning to type the address (ie. "sub" to get to my youtube subscriptions or "f" to get to facebook). Now, out of nowhere, this awful Bing search comes up ( with the magnifying glass symbols) first

  • URGENT : Add & Retrieve properties from Embedded LDAP in Weblogic 9.2

    I am using Embedded LDAP WebLogic 9.2 and i followed the steps mentioned in the URL below.I have nt changed anything except Server URL which points to localhost:7001. http://e-docs.bea.com/wlp/docs92/users/appendixa.html#wp1055363 Questions: 1)How to

  • Can't connect

    So I have been trying to set up my AirPort Express for about 4.5 hours now and I think it is time for help, I am trying to connect my AirPort Express to my current wireless network (comcast modem conected to a linksys WRT54G). I can not get it to con

  • New iMovie cannot find iPhoto Pictures

    Hello Community! After the update to the new iMovie, all pictures in my project mediathek are gone. He keeps telling me that he can't find the file path. In the old iMovie it still works. I imported the pictures from my iphoto mediathek. Any ideas ?

  • ABAP Runtime Error on EP

    Dear SDN, While I run particular BW report thru EP i Get ABAP Runtime Error. This error is observed only on particular PC, on rest its working fine.... also we uninstalled SAP GUI & Reinstalled it... but still error persist.... can any one suggest wh