Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

there is a *.sgm file. It is my data set I want to convert it to any other type of data set, which make me able to have access to it with program like WEKA. Weka mainly support *.arff file.

share|improve this question
1  
Can you provide more information - what software are you using, what OS etc. –  davidgo Mar 28 '13 at 7:11

2 Answers 2

.sgm is a standard; it is a type of XML file. You could try renaming the file extension to .xml or .arff (if you're happy to lose the XML)!

share|improve this answer

SGML is the precursor standard to XML, which is often thought of as a simplified version of SGML. Depending on how it was authored, you can probably rename it to .xml and do some minor editing to make it valid XML.

SGML has several features, such as tag minimization, that aren't in XML. For example (IIRC), these would be equivalent to an SGML parser:

<para/This is a paragraph./>
<para>This is a paragraph.</para>

(I might have the syntax slightly wrong for the first one, it's been quite a while.)

SGML can also imply the presence of required elements, something that XML doesn't do (you'd have to explicitly include them).

First step would be to grab a text editor (or command-line tool like xmlwf), rename it to .xml, and try cleaning it up until you run out of syntax errors. Text processing tools like perl might make your life easier if the same sorts of errors happen many times (you didn't mention how large your SGML file was).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.