[TxMt] Re: Can I treat my text document as a database? sanely?

Steve King sking at arbor.net
Wed Oct 22 17:52:40 UTC 2008


slothbear wrote:
> The order would stay in the file (for later submission to the game), but be
> marked as completed.
>
> Each time orders are applied, I'd have to parse the whole file, apply new
> orders, and change numbers and text here and there to reflect the new
> reality.  The files are relatively short (maybe 5 pages max), so I doubt
> performace would be a problem.
>
> Am I overloading the concept of text editing too much?  Too much to do?  Or
> just abusing the tool a bit?  Thanks for your ideas!
>   

No reason why you couldn't do it. Since TM commands can execute
arbitrary external programs, you could make the processing as complex as
you need. Feed the entire document to an external command and replace it
with the command's output. Personally I'd use some structured form of
text such as CSV or XML, but that's just me.

The only real question is that if you're going to be hand-editing the
text (and why else would you want to do this in an  editor?) your
processing commands are going to have to be good about malformed input. 
It'd be bad to have one typo wipe out your entire space fleet!  I'd also
use a version control system to save a history of every move made in
case you need to roll back at some point.

-- 
Steve King
Sr. Software Engineer
Arbor Networks
+1 734 821 1461
www.arbornetworks.com <http://www.arbornetworks.com/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20081022/20172e6e/attachment.html>


More information about the textmate mailing list