I have a plan file that looks something like this:
This is how file looks in plain form and this is how html source code looks if I view the source code in the browser. Of course when I view the page in the browser it does not look like this because there is no spacing between columns and fields because there is no formatting. Before I start to write my own parser, is there a parser out there already that can create an html file from this file using tables? I have one approach to replace all spaces with , but it's not very elegant. Any help is appreciated!
thanks, Alex
[ August 31, 2005: Message edited by: Alex Dubin ] [ August 31, 2005: Message edited by: Alex Dubin ]
For your input I think this will be a manual process, not something you'll find already written.
HTML tables are the easiest way to align columns. So you want to generate:
How will you parse the id, name and phone out of each row of your file? It looks like they are in fixed positions so you can use substring. Does that give you some ideas?
I said there is probably not a general solution, but in fact Wiki sites render plain text into HTML for a living. Tables usually have some special delimiter to help:
Full Wiki markup is non-trivial but fascinating. Look at the source for Fit or Fitnesse for an education.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi