Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output missing the last record #7

Open
GoogleCodeExporter opened this issue Jan 27, 2016 · 5 comments
Open

Output missing the last record #7

GoogleCodeExporter opened this issue Jan 27, 2016 · 5 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Create a file called records.xml with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<collection>
  <record>
    <datafield tag="020">
      <subfield code="a">version</subfield>
    </datafield>
    <datafield tag="040">
      <subfield code="b">stuff</subfield>
    </datafield>
  </record>
  <record>
    <datafield tag="020">
      <subfield code="a">version1</subfield>
      <subfield code="9">annotation1</subfield>
    </datafield>
    <datafield tag="020">
      <subfield code="a">version2</subfield>
      <subfield code="9">annotation2</subfield>
    </datafield>
    <datafield tag="040">
      <subfield code="b">yadda</subfield>
    </datafield>
  </record>
</collection>

2. Execute the following:
   xml2csv-conv.bat -l datafield records.xml records.csv

What is the expected output? 

See one row for each datafield element in the .xml file.

What do you see instead?

All datafield records except the last one are output to the .csv file.

What version of the product are you using? On what operating system?

Latest downloaded today 2012/04/10

Please provide any additional information below.

Windows, JDK 1.6.0_29

Original issue reported on code.google.com by chr...@stepaheadsoftware.com on 10 Apr 2012 at 5:32

@GoogleCodeExporter
Copy link
Author

I too have just come across this problem (I.E. last instance of selected field 
NOT being extracted/recorded in the output file) and this problem should be 
addressed URGENTLY as to be missing (for our example) a new customer record 
detail could be bad for business.

Original comment by slsglob...@slsglobals.karoo.co.uk on 21 Aug 2012 at 2:12

@GoogleCodeExporter
Copy link
Author

I have also encountered the same problem ! 

Original comment by robinga...@gmail.com on 19 Nov 2012 at 8:35

@GoogleCodeExporter
Copy link
Author

I have the same issue. did anyone found how to solve this ? thanks

Original comment by ste.ka...@gmail.com on 18 Jan 2013 at 11:14

@GoogleCodeExporter
Copy link
Author

I have consistently experienced this issue.  I have tried changing the order of 
the fields, including parent/child fields - have not been able to find a way to 
retain the last record.  

Original comment by coldit...@gmail.com on 1 Mar 2013 at 10:37

@GoogleCodeExporter
Copy link
Author

You have to change the code. Add this.printMapToResult(values); at line 199 in 
Main.java and rebuild the application. All necessary files can be found in 
source tab on this website.

Main.java should look like this:
...
198 this.parseValues((Node) root, 0);
199 this.printMapToResult(values);
200 return this.result;
...

In attachment, I dropped the new .jar file (so you don't have to rebuild 
yourself). For me it works fine with this new .jar.

Original comment by Stijn.Be...@gmail.com on 13 Nov 2013 at 10:00

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant