Hatchomatic

Hatchomatic

Share this post

Hatchomatic
Hatchomatic
Simple XML template
Copy link
Facebook
Email
Notes
More

Simple XML template

Joshua Hatch's avatar
Joshua Hatch
Feb 18, 2009

Share this post

Hatchomatic
Hatchomatic
Simple XML template
Copy link
Facebook
Email
Notes
More
Share

Quite often, I need to turn a tab-delimited text file or Excel spreadsheet into an XML document. The easiest way to do that is with a spreadsheet that uses a formulas to build the XML into one column. Here is such a file (actually, this is a collection of .xls, .xlsx, and Numbers '08 and Numbers '09 files). What you'll see is a seven-column spreadsheet with a header row. The seventh colum is simply a formula concatenating the other columns. That formula reads as follows:

="<a "&$A$1&"="""&A2&""" "&$B$1&"="""&B2&""" "&$C$1&"="""&C2&""" "&$D$1&"="""&D2&""" "&$E$1&"="""&E2&""" "&$F$1&"="""&F2&"""/>"

What that's saying is, the cell is equal to the literal text <a , followed by the absolute reference to cell A1, followed by the literal text =" followed by the relative reference to cell A2, and so on. The nice thing about this is that you can quickly and easily change the headers in the spreadsheet, and the XML will change accordingly. Likewise, you can change the values. And, it's relatively simple to add and delete attributes (columns) to grow or shrink the file as needed. Enjoy!


Subscribe to Hatchomatic

By Joshua Hatch
Musings on life, travel, pets, woodworking... whatever.

Share this post

Hatchomatic
Hatchomatic
Simple XML template
Copy link
Facebook
Email
Notes
More
Share

Discussion about this post

User's avatar
Building the Anarchist's Workbench
I'm following Christopher Schwarz's plans for a workbench that should long outlive me. Let's see how I do.
Jan 9, 2024 â€¢ 
Joshua Hatch
15

Share this post

Hatchomatic
Hatchomatic
Building the Anarchist's Workbench
Copy link
Facebook
Email
Notes
More
A Pair of Desks
When a friend asked me to build her a writing desk, I was deleted to do so. But I was much less delighted with how it turned out. So I took another stab…
Mar 29 â€¢ 
Joshua Hatch
12

Share this post

Hatchomatic
Hatchomatic
A Pair of Desks
Copy link
Facebook
Email
Notes
More
2
Putting It All Together
With the arrival of the bench hardware, assembly could commence and the workbench finished.
Jan 27, 2024 â€¢ 
Joshua Hatch
7

Share this post

Hatchomatic
Hatchomatic
Putting It All Together
Copy link
Facebook
Email
Notes
More

Ready for more?

© 2025 Joshua Hatch
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Copy link
Facebook
Email
Notes
More

Create your profile

User's avatar

Only paid subscribers can comment on this post

Already a paid subscriber? Sign in

Check your email

For your security, we need to re-authenticate you.

Click the link we sent to , or click here to sign in.