0

This seems like it should be simple enough to do, but I'm having a hard time doing it. I have a bunch of documents that we use for development in plain text so that I can automate the creation of these documents via scripts. Management wants all finalized documents in Word format. If i have a plain text numbered list like this:

1. Heading
  1.1 sub
  1.2 sub
2. Heading
  2.1 sub

How can I get that into any version of Word so that Word recognizes it as a numbered list and not just plain text that happens to start with numbers?

3
  • 1
    Can your numbers be recreated entirely from the structure? E.g., is the 3rd level 2 para below the 4th level 1 para always going to be para 4.2? If so, then you could consider using a standard sequence of replace operations in Word to find, e.g. [0-9].[0-9] using wildcards (the pattern needs a little work) and replace with Style Heading 2. Then repeat for [0-9]. And Heading1. Then apply the appropriate outline numbering scheme (or predefined it in your Word template).
    – user181946
    Jan 10, 2014 at 7:01
  • @bibadia They could be redacted. What you are suggesting is actually similar to what we are doing now. I was looking for a way to just run a script and then have final documents with no manual steps or Word automation.
    – user21826
    Jan 20, 2014 at 17:55
  • Not sure what you mean by "redacted" in this situation. Does it makes things simpler or more complicated? If you have a document with a multilevel numbering structure set up for Heading1, etc., with predictable numbering, all you have to do is surround each paragraph with the appropriate html heading level tags ( <h1>, <h2> etc., remove the manual numbering, replace special characters such as "<" as needed, put it all inside an <html> element, and insert that into the Word document (cf. Tonny's Answer). Mostly feasible outside Word. I'd have to think about the last bit.
    – user181946
    Jan 21, 2014 at 15:02

1 Answer 1

0

No way in hell that is going to happen automatically.

I think the easiest solution would be to have the generating script insert html tags for lists.
Then import it in Word as html.
That would preserve the formatting.

RTF is another possibility that is easily generated from a script and is understood by Word.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .