answersLogoWhite

0


Best Answer

An easy way would be to open the TXT file using Notepad or a comparable program, hit Ctrl+a to select all, Ctrl+c to copy, open up Microsoft Word 2007, hit Ctrl+v to paste, and save that as a XML doc.

An even easier way would be just to change the .txt extension to .xml, this should work as long as your etxt file has the correct xml syntaxt to denote an xml file eg

<xml> - denotes start of xml file

</xml> denotes end of xml file

User Avatar

Wiki User

βˆ™ 11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

βˆ™ 11y ago

A file containing XML markup and data isa text file, in the sense that it is stored in a plain file using a simple character encoding (often using UTF-8, also known as ASCII code). Such a file can be read using a typical "TXT" (or "ASCII") editor such as 'nano' on Linux or 'Notepad' on Windows. This process may be assisted by renaming the file, changing its file name extension from 'xml' to 'txt'. However, this file name change is not generally required.

However, viewing an XML file with a plain text editor presents the data and the meta data alike. Stripping the meta data (the XML markup) while preserving the content (the element values, the data) can be done through a process called transformation. Processing languages such as the XSLT language can be used to define the rules and automate the process of this conversion.

This answer is:
User Avatar

User Avatar

Wiki User

βˆ™ 11y ago

There is no general solution to convert data from an unstructured source (such as a plain text) into a structured form such as XML. The reason is that structured data contains structure, meta-datawhichdescribes data that follows.

For example, a plain text file might contain a title, followed by three paragraphs of text. A person might intuitively identify the title as the first, single, line of text, followed by a blank line, and might identify each paragraph as a portion of continuous text, separated by a blank line.


In a structured form, additional data is added to indicate the beginning and end of the title and each of the paragraphs. XML is one standard method of providing such additional data, which is often called 'meta-data' because it is data about data.


To convert unstructured data into structured data, one would generally require knowledge of the structure in order to define and apply suitable meta data. In the simplest form, such meta data could be a simple pair of "start of text" and "end of text" identifiers, although the usefulness of such an approach is generally questionable (as it doesn't add structure).

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you change a TXT file to a XML?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you create a XML file from Scratch?

it is the same way to create xml file by converting into txt you have to use the correct xml syntax ie &lt;xml&gt; this is to denote strat of xml file and this &lt;/xml&gt; denotes end of xml file. You have to use the right xml code or your xml file wont be valid or well formed.


How do you see bad XML file?

You can see or view an xml file with a plain text editor like notepad or you can use a dedicated xml editor. With an xml editor you can also validate your xml file which means you can correct any errors in your xml file.


How do you convert a exe file to a txt file?

You can't convert an exe file to a txt file.


Source code of xml?

there is no source code, xml is not a programming language, its a markup language for which you create your own tags, the basic xml syntax is &lt;xml&gt; to start an xml file, and &lt;/xml&gt; to end the xml file.


How do you convert txt to HTML?

If you have a .txt file that you want to be a html file, do this: open the .txt file and then save as and (change the name to what you want to call the file).html. Make sure that you 'save as' for all files or you will be saved as: somename.html.txt which will result it still be a text document. Make sure that you have the document in HTML format.


How can you reduce file size of a word document without sending a zip file?

Change the Doc format to . any other format like rich txt format or .TXT format


What are XML schemas?

an xml schema is a blueprint for your xml file and it dictates what can and cannot be in your xml file. it also is a blueprint as i said and so it outlines the tsructure of your file, the nodes, elements, child, attributes etc


What file type reduces the chance of file corruption pdf htm xml?

XML


What does txt file extension mean?

The file is just a plain text file. Txt is an abbreviation for text.


How do you Change HTML5 file to XML file?

I personally recommend html Parser by blogcrowds to convert html5 to xml. Simply add the html5 text to this tool and press the parse button. The new text will be in xml format. See the related link below.


How do you change an extension of File saved as XML?

First open your File Explore and navigate to the file. Make sure in Folder Options you have enabled showing extensions for known files. You may then right click and hit rename. From there backspace out the .XML and replace it with the file extension of your choosing.


What is difference between binary file and Excel file?

When referring to Excel 2007, there are two file types you can use when you save a file, XML and binary. If you save the file as binary, then there is no difference between the two. If you save the file as XML, then the XML file contains XML formatting data (explanation beyond the scope of this question) and the binary file is formatted for computers to read directly.