An .ai file contains graphical elements that, as you said, were created in Adobe Illustrator. Trying to convert an .ai file into a .txt one has no logical understanding because you can't do nothing with graphical elements in a text file, that is impossible.
As I can see, OSG deals with 3D elements which in this case, try and export the .ai file to these supported file formats:
3D database loaders include COLLADA, LightWave (.lwo), Alias Wavefront (.obj), OpenFlight (.flt), TerraPage (.txp) including multi-threaded paging support, Carbon Graphics GEO (.geo), 3D Studio MAX (.3ds), Peformer (.pfb), AutoCAd? (.dxf), Quake Character Models (.md2). Direct X (.x), and Inventor Ascii 2.0 (.iv)/ VRML 1.0 (.wrl), Designer Workshop (.dw) and AC3D (.ac) and the native .osg ASCII format.