Problem in reading a file

Hello,
I encounter a problem in an interface when I try to load the data which is in a Flat File.
After looking to this file we've seen that there is at the end a carriage return symbol, and when we remove it all seems better.
So I would like to know how to exclude this last symbol which let ODI think that there is another record at the end of the file ??
I'm using a LKM File to SQL Append and the file is a delimited one.
We've try to pass this symbol in the Record Code to Exclude in the datastore but nothing append.
thanks in advance.
BM

Hello Cezar,
thank you for your answer.
I can't answer you for the source file generation.
But we've seen that the problem come from the new ODI file Driver which bug if there is a blank record at the end of the file.
So we use the old one which permit us to treat our files.
Thanks again.
BM

Similar Messages

  • Problem While reading a file in text mode from Unix in ECC 5.0

    Hi Experts,
    I am working on Unicode Upgrade project of ECC5.0.
    Here i got a problem with reading a file format which it does successfully in 4.6 and not in ECC5.0
    My file format was as follows:
    *4 000001862004060300000010###/#######L##########G/##########G/########
    It was successfully converting corresponding field values in 4.6:
    *4
    00000186
    2004
    06
    03
    00000010
    25
    0
    4
    0
    54.75
    0
    54.75
    0.00
    While i am getting some problem in ECC5.0 during conversion of the above line:
    *4 000001862004060300000010###/#######L##########G/##########G/########
    it was consider in the same # values.
    I have used the following statement to open and read dataset.
    OPEN DATASET i_dsn IN LEGACY TEXT MODE FOR INPUT.
    READ DATASET i_dsn INTO pos_rec.
    Thanks for your help.
    Regards,
    Gopinath Addepalli.

    Hi
          You might be facing this problem because of uni code. So while opening or reading the file, there is a statement call ENCODING. Use that option and keep the code page which you want. Then the problem may be solved.
    Thanks & Regards.
    Harish.

  • Problem  while reading XML file from Aplication server(Al11)

    Hi Experts
    I am facing a problem while  reading XML file from Aplication server  using open data set.
    OPEN DATASET v_dsn IN BINARY MODE FOR INPUT.
    IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      READ DATASET v_dsn INTO v_rec.
    WHILE sy-subrc <> 0.
      ENDWHILE.
      CLOSE DATASET v_dsn.
    The XML file contains the details from an IDOC number  ,  the expected output  is XML file giving  all the segments details in a single page and send the user in lotus note as an attachment, But in the  present  output  after opening the attachment  i am getting a single XML file  which contains most of the segments ,but in the bottom part it is giving  the below error .
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/SHPORD_0080005842.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    for all the xml  its giving the error in bottom part ,  but once we open the source code and  if we saved  in system without changing anything the file giving the xml file without any error in that .
    could any one can help to solve this issue .

    Hi Oliver
    Thanx for your reply.
    see the latest output
    - <E1EDT13 SEGMENT="1">
      <QUALF>003</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803</NTEND>
      <NTENZ>000000</NTENZ>
      <ISDD>00000000</ISDD>
      <ISDZ>000000</ISDZ>
      <IEDD>00000000</IEDD>
      <IEDZ>000000</IEDZ>
      </E1EDT13>
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/~1922011.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    E1EDT13 with QUALF>003 and  <E1EDT13 SEGMENT="1">
    with   <QUALF>001 having almost same segment data . but  E1EDT13 with QUALF>003  is populating all segment data
    properly ,but E1EDT13 with QUALF>001  is giving in between.

  • Problem with reading config file

    Hello,
    I have problem with reading config file from the same dir as class is. Situation is:
    I have servlet which working with DB, and in confing file (config.pirms) are all info about connection (drivers, users, passw, etc.). Everything work fine if I hardcoded like:
    configFileName = "C:\\config.pirms";I need to avoid such hardcoding, I tryied to use:
    configFileName = Pirms.class.getClassLoader().getResourceAsStream ("/prj/config.pirms").toString();but it isn't work.
    My config file is in the same directory as Pirms.class (C:\apache-tomcat-5.5.17\webapps\ROOT\WEB-INF\classes\prj)
    Also I tryied BundledResources, it isn't work fo me also.
    Can anybody help me to solve this problem? with any examples or other stuff?
    Thanks in advance.
    Andrew

    Thanks, but I am getting error that "non-static method getServletConfig() cannot be referenced from a static context"
    Maybe is it possibility to use <init-param> into web.xml file like:
    <init-param>
      <param-name>configFile</param-name>
      <param-value>/prj/config.pirms</param-value>
    </init-param>If yes can anybody explain how to do that?
    I need to have that file for:
    FileReader readFile = new FileReader(configFile);Thanks in advance.

  • Problems when reading pdf files

    I use windows 7, and also have available Adobe Reader 5 and Adobe Reader X, but i receive some problems when reading pdf files. What can I do???

    Reader 5 is not Windows Compatible. Two different versions of the same computer can cause all sorts of problems. Remove all Acrobat and/or Reader software then re-install Reader X.

  • Problem while reading the file from FTP server

    Hi Friends,
    I have a problem while fetching files from FTP server.
    I used FTP_Connect, FTP_COMMAND function modules. I can able to put the files into FTP server.
    but I cant able to pick the files from FTP server.
    anyone have faced similar issues kindly let me know.
    Thanks
    Gowrishankar

    Hi,
    try this way..
    for reading the file using FTP you need to use different unix command ..
    Prabhuda

  • Problem in Reading XLSX File (MS EXCEL 2007).

    Dear All ,
    I am reading all the properties to XL sheet and then utilising it in my code .
    I am getting some problem in reading the Border of the Cell , my code is working fine with most of the Excel Sheet but it can not correctly read the Border of a few Excel files.
    I am using the method ,
    getBorderBottomEnum()
    or
    getBorderBottom()
    but I can not read the Border used correctly for all the Excel Sheet .
    Please Help.
    Please revert if I am not clear.
    Thanking You All.

    I'm guessing that your question is about Apache POI. They don't have a forum AFAIK, but they do have a [url http://poi.apache.org/mailinglists.html]mailing list.
    John

  • Problems with reading XML files with ISO-8859-1 encoding

    Hi!
    I try to read a RSS file. The script below works with XML files with UTF-8 encoding but not ISO-8859-1. How to fix so it work with booth?
    Here's the code:
    import java.io.File;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import java.net.*;
    * @author gustav
    public class RSSDocument {
        /** Creates a new instance of RSSDocument */
        public RSSDocument(String inurl) {
            String url = new String(inurl);
            try{
                DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                Document doc = builder.parse(url);
                NodeList nodes = doc.getElementsByTagName("item");
                for (int i = 0; i < nodes.getLength(); i++) {
                    Element element = (Element) nodes.item(i);
                    NodeList title = element.getElementsByTagName("title");
                    Element line = (Element) title.item(0);
                    System.out.println("Title: " + getCharacterDataFromElement(line));
                    NodeList des = element.getElementsByTagName("description");
                    line = (Element) des.item(0);
                    System.out.println("Des: " + getCharacterDataFromElement(line));
            } catch (Exception e) {
                e.printStackTrace();
        public String getCharacterDataFromElement(Element e) {
            Node child = e.getFirstChild();
            if (child instanceof CharacterData) {
                CharacterData cd = (CharacterData) child;
                return cd.getData();
            return "?";
    }And here's the error message:
    org.xml.sax.SAXParseException: Teckenkonverteringsfel: "Malformed UTF-8 char -- is an XML encoding declaration missing?" (radnumret kan vara f�r l�gt).
        at org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1100)
        at org.apache.crimson.parser.InputEntity.fillbuf(InputEntity.java:1072)
        at org.apache.crimson.parser.InputEntity.isXmlDeclOrTextDeclPrefix(InputEntity.java:914)
        at org.apache.crimson.parser.Parser2.maybeXmlDecl(Parser2.java:1183)
        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:653)
        at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
        at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
        at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
        at getrss.RSSDocument.<init>(RSSDocument.java:25)
        at getrss.Main.main(Main.java:25)

    I read files from the web, but there is a XML tag
    with the encoding attribute in the RSS file.If you are quite sure that you have an encoding attribute set to ISO-8859-1 then I expect that your RSS file has non-ISO-8859-1 character though I thought all bytes -128 to 127 were valid ISO-8859-1 characters!
    Many years ago I had a problem with an XML file with invalid characters. I wrote a simple filter (using FilterInputStream) that made sure that all the byes it processed were ASCII. My problem turned out to be characters with value zero which the Microsoft XML parser failed to process. It put the parser in an infinite loop!
    In the filter, as each byte is read you could write out the Hex value. That way you should be able to find the offending character(s).

  • Problem while reading multiple files through FTP Adapter

    Hi,
    We have a requirement to read the excel files placed in an FTP Location and as there is no Adapter to read Excel file
    we are using FTP Adapter and reading the Header values of the file(name of the
    file) and we are paasing as input to the Java code which will read the data nd insert into the Database.
    If we place above 20 files it was reading only some files and some were left and if we delete the files and place the unread files again some files are read and if we do the same procedure then all the files were read.
    Any help regaring this appreciated.
    Thanks and Regards,
    Nagaraju .D

    Are you doing anything complex for your polling, e.g. Files that must be n time old.
    Can you post the WSDL so I can see the polling configuration. I only need to see the adapter configuration, not the whole file.
    cheers
    James

  • Problem in reading a file in the specified format

    Hi,
    I want to read a .txt file using the bufferedreader() but the text displayed in the console doesnot show data in new lines though there are multiple lines in the text file.It shows the content of the file in one line.
    ex: file.txt
    1. Here
    2. Is the code
    When I retrive the file it shows the following o/p in the console :
    O/P
    HereIs the code
    Expected o/p
    Here
    IS the code
    Please help me.
    Thanks in advance
    Regard Devi

    Your are not using parentheses {} with your while loop, and you really should.
    I believe that the problem is that the new line character is not being included.
    It's good to use the readLine() method, but you have to remember that it does
    not return the "end of line characters" so you would have to supply that yourself.
    Fortunately, System.out.println() will add a new line for you, but you would have
    to call it after each readLine() for it to look right.
    Also, I don't see why you are using both s1 and y. Here is an example using the
    variable "line" to hold the line of text being read.
    BufferedReader screenReader = new BufferedReader(new InputStreamReader(System.in));
    System.out.print("Enter the File name: ");
    String str = screenReader.readLine();
    BufferedReader br = new BufferedReader(new FileReader(str));
    String line = "";
    while ((line = br.readLine()) != null) {
         System.out.println(line);
    }Hope it helps.

  • Problems with reading raw files in lightroom 5

    Ich kann weder dng Dateien von Leica x1 noch von fuji xt1 importieren! Was könnte der Grund sein, im Handbuch gibt es keine Hinweise auf Probleme?@ Kurze Antwort erwünscht

    Check the destination you have specified in the Import panel.  It needs to point to a location that Lightroom can read and more important write files to.  Usually the error message (in English) says “files cannot be read” and this really means that LR was unable to copy the files to the destination so then when it tried to import from that destination not file were found to read.

  • Problem with reading mp4 files with QT 7.4.1 or mpeg Streamclip

    Hi,
    I used to convert some .flv files into .mp4 files with iSquint and then into .dv files with mpeg Streamclip in order to re-work and compile these files on a DVD using iMovie and iDVD.
    However I cannot do it anymore since I upgraded to QT 7.4.1. iSquint uses the mpeg-4 video codec to convert the file. Therefore I cannot open them with QT 7.4.1 anymore and I cannot convert them into .dv files with mpeg Streamclip anymore since Streamclip is uses a QT plug-in.
    I have tried to solve the problem using Perian but this plug-in does not work with my version of Mac (Panther 10.3.9). I also tried to downgrade to an older QT using Pacifist but it nearly crashed my whole computer (fortunately I could fix that by reinstalling QT 7.4.1).
    Has someone a solution to my problem?
    Thank you in advance.
    Steve

    Not all the following will apply to Panther (10.3.x) so look carefully on the sites mentioned for the correct versions:
    These are the downloads and the settings you need in order to view/hear pretty much everything that the net can throw at you: The setup described below has proved repeatedly successful on both PPC and Intel macs, but nothing in life carries a guarantee!
    It is known to work in the great majority of cases with Safari 3.0.4, QT 7.3 or 7.4 and OS 10.4.11. (If you are running Leopard, ensure that all plug-ins have been updated for OS 10.5)
    Assuming you already run Tiger versions OS 10.4.9 or above (this has not yet been verified with Leopard) and have Quicktime 7.2 or above, and are using Safari 2 or 3, download and install (or re-install even if you already had them) the latest versions, suitable for your flavor of Mac, of:
    RealPlayer 10 for Mac from http://forms.real.com/real/player/blackjack.html?platform2=Mac%20OS%20X&product= RealPlayer%2010&proc=g3&lang=&show_list=0&src=macjack
    Flip4Mac WMV Player from http://www.microsoft.com/windows/windowsmedia/player/wmcomponents.mspx (Windows Media Player for the Mac is no longer supported, even by Microsoft)
    Perian from http://perian.org/
    You should read this support page http://perian.org/#support in case you need to delete older codecs.
    Adobe FlashPlayer should first be uninstalled using the appropriate uninstaller available here: http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14157&sliceId=2 and then the latest version obtained from here: http://www.adobe.com/shockwave/download/download.cgi?P1ProdVersion=ShockwaveFlash and installed.
    (You can check here: http://www.adobe.com/products/flash/about/ to see which version you should install for your Mac and OS.)
    In earlier versions than QT 7.1.3 in Quicktime Preferences, under advanced, UNcheck Enable Flash, and under Mime settings/Miscellananeous only check Quicktime HTML (QHTM).
    You should also ensure, if you are running Tiger 10.4.11 or Leopard, that you have downloaded and installed the correct version for your Mac of Security Update 2007-009.1.1, which also deals with the Quicktime/Flash issues you may have experienced, such as the '?'. What happened was that both Quicktime as well as Adobe FlashPlayer tried to play the Flash video at the same time. This no longer happens. (N.B. Security Update 2007-009 1.1 requires both a restart and a permission repair.)
    If you get problems with viewing video on a website try moving this file to your Desktop:
    Hard drive/Library/Internet Plug-Ins/QuickTime Plugin.webplugin
    and then restarting Safari. If all now works, you can trash that file.
    In Macintosh HD/Library/Quicktime/ delete any files relating to DivX (Perian already has them). However it should be noted that Perian is not an internet plugin and will not play DivX files imbedded on a website. For that you will need the DivX Player browser plugin available from http://www.divx.com/divx/mac/
    Now go to Safari Preferences/Security, and tick the boxes under Web Content (all 4 of them) to enable Java.
    Lastly open Audio Midi Setup (which you will find in the Utilities Folder of your Applications Folder) and click on Audio Devices. Make sure that both Audio Input and Audio Output, under Format, are set to 44100 Hz, and that you have selected 'Built in Audio'.
    Important: Now repair permissions and restart.
    You should also consider having the free VLC Player from http://www.videolan.org/ in your armory, as this plays almost anything that DVD Player might not.

  • Problems with reading in files

    I have a compalation problem which throws back the following error:
    Echo.java:11: unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown
    Scanner scanFile = new Scanner(new File("file"));
    ^
    1 error
    Thanks in advanced.

    Here's Sun's exception tutorial: http://java.sun.com/docs/books/tutorial/essential/exceptions/index.html
    Here's a quick overview of exceptions:
    The base class for all exceptions is Throwable. Java provides Exception and Error that extend Throwable. RuntimeException (and many others) extend Exception.
    RuntimeException and its descendants, and Error and its descendants, are called unchecked exceptions. Everything else is a checked exception.
    If your method, or any method it calls, can throw a checked exception, then your method must either catch that exception, or declare that your method throws that exception. This way, when I call your method, I know at compile time what can possibly go wrong and I can decide whether to handle it or just bubble it up to my caller. Catching a given exception also catches all that exception's descendants. Declaring that you throw a given exception means that you might throw that exception or any of its descendants.
    Unchecked exceptions (RuntimeException, Error, and their descendants) are not subject to those restrictions. Any method can throw any unchecked exception at any time without declaring it. This is because unchecked exceptions are either the sign of a coding error (RuntimeException), which is totally preventable and should be fixed rather than handled by the code that encounters it, or a problem in the VM, which in general can not be predicted or handled.
    So you have to either catch that exception, or announce to any caller (via the throws clause in the method declaration) that your method can throw that exception.

  • Problem in reading xml file from server

    Hi,
    I am using tomcat 4.1 and jdk 1.4.
    All the class files and xml files are put into the one jar file.
    While running our application a jar file is called from jsp file. in that file we are embedded applet coding. here by i am sending my applet code with this...
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    WIDTH = "500" HEIGHT = "500" codebase="http://java.sun.com/products/plugin/1.2/jinstall-12-win32.cab#Version=1,2,0,0">
    <PARAM NAME = CODE VALUE = "Screen.class" >
    <PARAM NAME = CODEBASE VALUE = "/Sample/web/" >
    <PARAM NAME = ARCHIVE VALUE = "csr.jar" >
    </NOEMBED></EMBED>
    </OBJECT>
    while running our application from another machine we are getting exception filenotfounfexception in the xml is in the generated jar file.
    Exception:
    org.xml.sax.SAXParseException: File "file:///C:/Documents and Settings/Administrator/Desktop/control_property.xml" not found.
    but that xml file is in the jar file and that jar file is present under sample application folder.
    what should i change in the applet code? is there any thing related to trusted applet ?
    Thanks

    You have the xml file in the jar so it is a resource?
    http://java.sun.com/docs/books/tutorial/uiswing/misc/icon.html#getresource
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/ClassLoader.html#getResource(java.lang.String)

  • Problem while reading XML File from Memory

    I want to read the data from an XML File which is residing in memory.The XML File should be read not by the name or the location of the file but by a Response String.
    So Can anybody help me out how can get this.
    I tried it with BufferedInputStream but BufferedInputStream needs InputStream as a Parameter and i am not able to get what parameter should be passed into the BufferedInputStream as the syntax of this is
    BufferedInputStream(InputStream in)
    Its very Urgent !!!
    Thanks in Advance

    I have created the parsing method.
    The code is like this.
    if(response.toString().equals("CS_NEWS_RESPONSE"))
    *//InputStream in = new BufferedInputStream(InputStream());*
    *//InputStream in = new BufferedInputStream(response.toString());*
    *//BufferedInputStream b = new BufferedInputStream(in);*
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    Document doc = docBuilder.parse(in);
              Element root = doc.getDocumentElement();
    The code will go like this....
    response.toString() is containing the response type which is the identification of that particular XML File. By using this my file is identified and after identification of this file, i should read the contents and parse them.
    Sentences in the bold are the ways. Is this the correct way ??
    Amit Will you be able to help me or is there anybody else who knows about this.
    Edited by: Monadear on Oct 5, 2007 9:37 AM

  • Problem in reading Text file(Unicode)

    Hi
    i am trying to read a tab delimited text file which has Unicode Encoding
    try{
        BufferedReader reader = new BufferedReader(
          new InputStreamReader(
            new FileInputStream(
              "C:/Documents and Settings/divya.parkash/Desktop/Testting.txt"),
              "UTF8"));
       int buf;
       while((buf=reader.read())>-1){
        if (buf!=0)
         str.append((char)buf);
       System.out.println(str.toString());
       catch (Exception e){System.out.println("Res: "+e);}
       }but i am geting two ?? marks before the text
    ??STD_BIN HI 0  100 U10 21010100       66.550       20.000        1.000           1.200        1.200        1.300 0  100 RACKED 0 0
    STD_BIN LO 21010200  100 U10 21010200       66.550       20.000        3.000           1.200        1.200        1.300 0  100 RACKED 0 0
    STD_BIN LO 21010300  100 U10 21010300       66.550       20.000        5.000           1.200        1.200        1.300 0  100 RACKED 0 0
    STD_BIN LO 21010400  100 U10 21010400       66.550       20.000        7.000           1.200        1.200        1.300 0  100 RACKED 0 0
    STD_BIN LO 21010500  100 U10 21010500       66.550       20.000        9.000           1.200        1.200        1.300 0    0 RACKED 0 0
    STD_BIN LO 21010600  100 U10 21010600       66.550       20.000       11.000           1.200        1.200        1.300 0    0 RACKED 0 0So please suggest me the reason and solution

    Hi
    calvino_ind
    this is the output i am getting by keeping buf as int.......
    553365533838468956673789727394899494848985494895049484948494848932323232323254544653534893232323232325048464848489323232323232324946484848999932323232323232494650484893232323232323249465048489323232323232324946514848948932494848982656775696894894813108384689566737897679950494849485048489949484898549489504948494850484893232323232325454465353489323232323232504846484848932323232323232514648484899993232323232323249465048489323232323232324946504848932323232323232494651484894893249484898265677569689489481310838468956673789767995049484948514848994948489854948950494849485148489323232323232545446535348932323232323250484648484893232323232323253464848489999323232323232324946504848932323232323232494650484893232323232323249465148489489324948489826567756968948948131083846895667378976799504948494852484899494848985494895049484948524848932323232323254544653534893232323232325048464848489323232323232325546484848999932323232323232494650484893232323232323249465048489323232323232324946514848948932494848982656775696894894813108384689566737897679950494849485348489949484898549489504948494853484893232323232325454465353489323232323232504846484848932323232323232574648484899993232323232323249465048489323232323232324946504848932323232323232494651484894893232324898265677569689489481310838468956673789767995049484948544848994948489854948950494849485448489323232323232545446535348932323232323250484648484893232323232324949464848489999323232323232324946504848932323232323232494650484893232323232323249465148489489323232489826567756968948948131083846895667378976799504948494855484899494848985494895049484948554848932323232323254544653534893232323232325048464848489323232323232495146484848999932323232323232494650484893232323232323249465048489323232323232324946514848948932323248982656775696894894813108384689566737897679950494849485648489949484898549489504948494856484893232323232325454465353489323232323232504846484848932323232323249534648484899993232323232323249465048489323232323232324946504848932323232323232494651484894893232324898265677569689489481310

Maybe you are looking for