how to convert large xml files to csv format?
I tried it online but the size is too big.
i want to convert large xml files nearly 50 mb to csv format which is unable to be done at all neither online nor in any software.
i wanna know what should be the best idea to convert them thanks
xml csv
add a comment |
I tried it online but the size is too big.
i want to convert large xml files nearly 50 mb to csv format which is unable to be done at all neither online nor in any software.
i wanna know what should be the best idea to convert them thanks
xml csv
2
Welcome to Stack Overflow! Please take the tour, look around, and read through the Help Center, in particular How do I ask a good question? If you run into a specific problem, research it thoroughly, search thoroughly here, and if you're still stuck post your code and a description of the problem. Also, remember to include Minimum, Complete, Verifiable Example. People will be glad to help
– Andreas
Nov 23 '18 at 3:31
2
50mb is not particularly large these days and it shouldn't require any special treatment. This is a routine task, which many people would tackle without difficulty using XSLT. You need to show us what you tried and how it failed, and then we can tell you what you did wrong.
– Michael Kay
Nov 23 '18 at 9:01
add a comment |
I tried it online but the size is too big.
i want to convert large xml files nearly 50 mb to csv format which is unable to be done at all neither online nor in any software.
i wanna know what should be the best idea to convert them thanks
xml csv
I tried it online but the size is too big.
i want to convert large xml files nearly 50 mb to csv format which is unable to be done at all neither online nor in any software.
i wanna know what should be the best idea to convert them thanks
xml csv
xml csv
asked Nov 23 '18 at 3:29
Ali Ahmed KhanAli Ahmed Khan
6
6
2
Welcome to Stack Overflow! Please take the tour, look around, and read through the Help Center, in particular How do I ask a good question? If you run into a specific problem, research it thoroughly, search thoroughly here, and if you're still stuck post your code and a description of the problem. Also, remember to include Minimum, Complete, Verifiable Example. People will be glad to help
– Andreas
Nov 23 '18 at 3:31
2
50mb is not particularly large these days and it shouldn't require any special treatment. This is a routine task, which many people would tackle without difficulty using XSLT. You need to show us what you tried and how it failed, and then we can tell you what you did wrong.
– Michael Kay
Nov 23 '18 at 9:01
add a comment |
2
Welcome to Stack Overflow! Please take the tour, look around, and read through the Help Center, in particular How do I ask a good question? If you run into a specific problem, research it thoroughly, search thoroughly here, and if you're still stuck post your code and a description of the problem. Also, remember to include Minimum, Complete, Verifiable Example. People will be glad to help
– Andreas
Nov 23 '18 at 3:31
2
50mb is not particularly large these days and it shouldn't require any special treatment. This is a routine task, which many people would tackle without difficulty using XSLT. You need to show us what you tried and how it failed, and then we can tell you what you did wrong.
– Michael Kay
Nov 23 '18 at 9:01
2
2
Welcome to Stack Overflow! Please take the tour, look around, and read through the Help Center, in particular How do I ask a good question? If you run into a specific problem, research it thoroughly, search thoroughly here, and if you're still stuck post your code and a description of the problem. Also, remember to include Minimum, Complete, Verifiable Example. People will be glad to help
– Andreas
Nov 23 '18 at 3:31
Welcome to Stack Overflow! Please take the tour, look around, and read through the Help Center, in particular How do I ask a good question? If you run into a specific problem, research it thoroughly, search thoroughly here, and if you're still stuck post your code and a description of the problem. Also, remember to include Minimum, Complete, Verifiable Example. People will be glad to help
– Andreas
Nov 23 '18 at 3:31
2
2
50mb is not particularly large these days and it shouldn't require any special treatment. This is a routine task, which many people would tackle without difficulty using XSLT. You need to show us what you tried and how it failed, and then we can tell you what you did wrong.
– Michael Kay
Nov 23 '18 at 9:01
50mb is not particularly large these days and it shouldn't require any special treatment. This is a routine task, which many people would tackle without difficulty using XSLT. You need to show us what you tried and how it failed, and then we can tell you what you did wrong.
– Michael Kay
Nov 23 '18 at 9:01
add a comment |
1 Answer
1
active
oldest
votes
XML is a standard format for content. I would approach this as two steps. Google "parse xml" and "generate csv". Your program will implement both and then you'll be done. There are a number of options.
Also, consider using a program that reads XML files and uses XSLT files to do the transformation. If you pop over to W3schools there is a tutorial about XML and XLST:
w3schools xsl tutorial. The XSL usually is used to generate HTML from an XML file, but an HTML file is just text. You could output the CSV directly. (There are some issues with CSV that cause some headaches, such as punctuation including commas and double quotes that can mess up the CSV, but there are workarounds.
This snippet is an example of generating a two column CSV file pulling out Title and Artist from an XML file containing those tags. The second line is the header line for CSV and the rest of the template forms each subsequent line in the CSV file:
<xsl:template match="/">
Title,Artistn
<xsl:for-each select="catalog/cd">
<xsl:value-of select="title"/>,<xsl:value-of select="artist"/>n
</xsl:for-each>
</xsl:template>
The n imbedded in the template needs to be whatever is the new line character in the processor you choose. Substitute the correct tag names for your application. The Saxan and Xalan are two projects that implement the process. XSLTproc XSLTproc is available here is a command line tool. If you do this in a browser you could implement the html table syntax from the example at w3schools.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53440331%2fhow-to-convert-large-xml-files-to-csv-format%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
XML is a standard format for content. I would approach this as two steps. Google "parse xml" and "generate csv". Your program will implement both and then you'll be done. There are a number of options.
Also, consider using a program that reads XML files and uses XSLT files to do the transformation. If you pop over to W3schools there is a tutorial about XML and XLST:
w3schools xsl tutorial. The XSL usually is used to generate HTML from an XML file, but an HTML file is just text. You could output the CSV directly. (There are some issues with CSV that cause some headaches, such as punctuation including commas and double quotes that can mess up the CSV, but there are workarounds.
This snippet is an example of generating a two column CSV file pulling out Title and Artist from an XML file containing those tags. The second line is the header line for CSV and the rest of the template forms each subsequent line in the CSV file:
<xsl:template match="/">
Title,Artistn
<xsl:for-each select="catalog/cd">
<xsl:value-of select="title"/>,<xsl:value-of select="artist"/>n
</xsl:for-each>
</xsl:template>
The n imbedded in the template needs to be whatever is the new line character in the processor you choose. Substitute the correct tag names for your application. The Saxan and Xalan are two projects that implement the process. XSLTproc XSLTproc is available here is a command line tool. If you do this in a browser you could implement the html table syntax from the example at w3schools.
add a comment |
XML is a standard format for content. I would approach this as two steps. Google "parse xml" and "generate csv". Your program will implement both and then you'll be done. There are a number of options.
Also, consider using a program that reads XML files and uses XSLT files to do the transformation. If you pop over to W3schools there is a tutorial about XML and XLST:
w3schools xsl tutorial. The XSL usually is used to generate HTML from an XML file, but an HTML file is just text. You could output the CSV directly. (There are some issues with CSV that cause some headaches, such as punctuation including commas and double quotes that can mess up the CSV, but there are workarounds.
This snippet is an example of generating a two column CSV file pulling out Title and Artist from an XML file containing those tags. The second line is the header line for CSV and the rest of the template forms each subsequent line in the CSV file:
<xsl:template match="/">
Title,Artistn
<xsl:for-each select="catalog/cd">
<xsl:value-of select="title"/>,<xsl:value-of select="artist"/>n
</xsl:for-each>
</xsl:template>
The n imbedded in the template needs to be whatever is the new line character in the processor you choose. Substitute the correct tag names for your application. The Saxan and Xalan are two projects that implement the process. XSLTproc XSLTproc is available here is a command line tool. If you do this in a browser you could implement the html table syntax from the example at w3schools.
add a comment |
XML is a standard format for content. I would approach this as two steps. Google "parse xml" and "generate csv". Your program will implement both and then you'll be done. There are a number of options.
Also, consider using a program that reads XML files and uses XSLT files to do the transformation. If you pop over to W3schools there is a tutorial about XML and XLST:
w3schools xsl tutorial. The XSL usually is used to generate HTML from an XML file, but an HTML file is just text. You could output the CSV directly. (There are some issues with CSV that cause some headaches, such as punctuation including commas and double quotes that can mess up the CSV, but there are workarounds.
This snippet is an example of generating a two column CSV file pulling out Title and Artist from an XML file containing those tags. The second line is the header line for CSV and the rest of the template forms each subsequent line in the CSV file:
<xsl:template match="/">
Title,Artistn
<xsl:for-each select="catalog/cd">
<xsl:value-of select="title"/>,<xsl:value-of select="artist"/>n
</xsl:for-each>
</xsl:template>
The n imbedded in the template needs to be whatever is the new line character in the processor you choose. Substitute the correct tag names for your application. The Saxan and Xalan are two projects that implement the process. XSLTproc XSLTproc is available here is a command line tool. If you do this in a browser you could implement the html table syntax from the example at w3schools.
XML is a standard format for content. I would approach this as two steps. Google "parse xml" and "generate csv". Your program will implement both and then you'll be done. There are a number of options.
Also, consider using a program that reads XML files and uses XSLT files to do the transformation. If you pop over to W3schools there is a tutorial about XML and XLST:
w3schools xsl tutorial. The XSL usually is used to generate HTML from an XML file, but an HTML file is just text. You could output the CSV directly. (There are some issues with CSV that cause some headaches, such as punctuation including commas and double quotes that can mess up the CSV, but there are workarounds.
This snippet is an example of generating a two column CSV file pulling out Title and Artist from an XML file containing those tags. The second line is the header line for CSV and the rest of the template forms each subsequent line in the CSV file:
<xsl:template match="/">
Title,Artistn
<xsl:for-each select="catalog/cd">
<xsl:value-of select="title"/>,<xsl:value-of select="artist"/>n
</xsl:for-each>
</xsl:template>
The n imbedded in the template needs to be whatever is the new line character in the processor you choose. Substitute the correct tag names for your application. The Saxan and Xalan are two projects that implement the process. XSLTproc XSLTproc is available here is a command line tool. If you do this in a browser you could implement the html table syntax from the example at w3schools.
answered Nov 23 '18 at 17:36
kd4ttckd4ttc
6191723
6191723
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53440331%2fhow-to-convert-large-xml-files-to-csv-format%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Welcome to Stack Overflow! Please take the tour, look around, and read through the Help Center, in particular How do I ask a good question? If you run into a specific problem, research it thoroughly, search thoroughly here, and if you're still stuck post your code and a description of the problem. Also, remember to include Minimum, Complete, Verifiable Example. People will be glad to help
– Andreas
Nov 23 '18 at 3:31
2
50mb is not particularly large these days and it shouldn't require any special treatment. This is a routine task, which many people would tackle without difficulty using XSLT. You need to show us what you tried and how it failed, and then we can tell you what you did wrong.
– Michael Kay
Nov 23 '18 at 9:01