Results 1 to 8 of 8
  1. #1
    maxzsim is offline Member
    Join Date
    Dec 2013
    Posts
    4
    Rep Power
    0

    Default How to ignore \ in the data records

    Hi,

    I am using ecplise csvwriter and csvreader to read and write and while the program was searching thru each record, it failed to read 1 record and it was treated as the end of the file.

    From my investigation, i noticed that one of the column has / within the text and after removing it, it was ok.

    Ques : How can i make the system recognize that / in Row x is not actually the end of the file or basically how to ignore it


    Code :

    csvWriter = new CSVWriter(fileWriter, MRTFormat.MRT_FIELD_SEPARATOR, CSVWriter.NO_QUOTE_CHARACTER);

    where MRT_FIELD_SEPARATOR is "|" without the double quotes

    Appreciate your reply

    rdgs

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default Re: How to ignore \ in the data records

    make the system recognize that / in Row x is not actually the end of the file
    What program is seeing the '/' character as end of file? What is "the system" that you are talking about?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    maxzsim is offline Member
    Join Date
    Dec 2013
    Posts
    4
    Rep Power
    0

    Default Re: How to ignore \ in the data records

    The system i am referring to is the java program. Rather the program is seeing "\" as the Escape character of a column. --> i gave the wrong symbol earlier

    I have the columns as "this is a is column 1"\"this is column 2" but in actual fact there should be 2 columns
    Last edited by maxzsim; 12-26-2013 at 02:59 AM. Reason: correcting some typo errors

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default Re: How to ignore \ in the data records

    The "\" or the "/" are just two characters treated like any other character by java when read and written to a file.
    The javac program treats a "\" as an escape character when it is reading a java source file.

    I have the columns as >"this is a is column 1"\"this is column 2"<but in actual fact there should be 2 columns
    What program is reading the characters between the > and the < and creating one or two columns from those characters?

    What is the "end of file" problem?
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    maxzsim is offline Member
    Join Date
    Dec 2013
    Posts
    4
    Rep Power
    0

    Default Re: How to ignore \ in the data records

    Quote Originally Posted by Norm View Post
    The "\" or the "/" are just two characters treated like any other character by java when read and written to a file.
    The javac program treats a "\" as an escape character when it is reading a java source file.


    What program is reading the characters between the > and the < and creating one or two columns from those characters?

    ==> The program is reading it as a one column when there should be 2 columns

    What is the "end of file" problem?
    ==> Please ignore the "end of file" problem , it was a wrong understanding on my part

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default Re: How to ignore \ in the data records

    Is the problem solved now?
    If not, please post the code that is the problem and show an example of what the code is doing that demonstrates the problem.
    If you don't understand my response, don't ignore it, ask a question.

  7. #7
    maxzsim is offline Member
    Join Date
    Dec 2013
    Posts
    4
    Rep Power
    0

    Default Re: How to ignore \ in the data records

    Quote Originally Posted by Norm View Post
    Is the problem solved now?
    If not, please post the code that is the problem and show an example of what the code is doing that demonstrates the problem.
    The problem is still there actually.

    I have uploaded 2 files , main file is the ConvertApp.txt. It was at line 127 while it was reading the record where it encounters the"\" and to the system there was no exception thrown but when i removed the "\|, it was able to continue till the end of the file
    Attached Files Attached Files

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default Re: How to ignore \ in the data records

    Can you trim the files down to a much smaller size, like line 6 lines vs 127+ and post them here vs as attachments?
    Also you need to post the java code you are using that have the problems.
    Be sure to put the java code in code tags.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. How do I ignore an alert?
    By kkid in forum NetBeans
    Replies: 4
    Last Post: 11-09-2012, 12:42 PM
  2. Replies: 12
    Last Post: 10-25-2012, 05:26 PM
  3. ignore backspace
    By Kyle227 in forum New To Java
    Replies: 6
    Last Post: 05-16-2010, 09:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •