Archive of UserLand's first discussion group, started October 5, 1998.

Re: XML markup of large text file

Author:Yegor Malov
Posted:6/16/1999; 10:26:30 AM
Topic:XML markup of large text file
Msg #:7448 (In response to 7433)
Prev/Next:7447 / 7449

Hello!

I think you can do without writing a script here. I would use some powerful text editor to do the job, i.e. MS Word.
The idea in general is to replace delimiters with pieces of XML code. In your case there's a bit of a problem with delimiters - how to know the first colon from the second in every line to do the right substitution.
In MS Word I would do the following (but I suppose it can be done in in any word processor that supports tables):

  1. select all the text
  2. convert it to table with colon as the delimiter
    (now we get level 1 categories in the first column of a table, level 2 - in the second, etc)
  3. insert an empty column after the first one
  4. select all the table
  5. convert it back to text, use any delimiter, you might use the colon as well
now the first category is separated with double colon, i.e.

Europe:: UK: Scotland

and you can replace easily now

Please contact me in case you have any difficulties with this





There are responses to this message:


This page was archived on 6/13/2001; 4:50:50 PM.

© Copyright 1998-2001 UserLand Software, Inc.