Is there a way to export block attributes to a space deliminated text file, from the command line or toolbar button?

We use scripts to open multiple files from a project and then export BOM and Title block block attributes to a text file for import to our ERP system. Putting this function on a toolbar button would be fine until we get API functionality.  I have been having two problems. 

1.  Cannot export to a space deliminated text file without using a dialog box (attext)

2.  DS does not like the template file I have using for acad.  Specifically, it does not like the first two lines (bl:name and dwg.no.)

BL:NAME      C008000

DWG.NO.      C020000

TITLE1       C035000

TITLE2       C035000

TITLE3       C035000

BM_PART      C020000

BM_DESC      C035000

BM_DESC2     C035000

BM_DESC3     C035000

BM_QTY       N004000

BM_ITEM      C003000

DRAFTSMAN    C008000

 

Any help would be appreciated.