Author Topic: import/export txt files  (Read 5060 times)

Adler

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
import/export txt files
« on: September 21, 2013, 01:20:20 am »
Hello dear community,

is it possible to read and write simple .txt files in scripts executed directly in the EA? As far as i see its generally possible to import source code files and to export RTF documents, so the basic functionalities for reading and writing txt file seem to be available. But i cant find an appropriate method in the EA/Repository/Session.

I'm aware that i can access the EA model data from other applications and thus use the parsing capabilities of C++ or Java. But i would prefer to stick to EA scripting to get an all-one-tool solution.


Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: import/export txt files
« Reply #1 on: September 21, 2013, 01:32:22 am »
Hello,

in scripting and in Addins you can read or write files. There is no EA API because the languages are coming with a lot of interfaces. One is file IO.

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

johann

  • EA User
  • **
  • Posts: 27
  • Karma: +2/-0
    • View Profile
Re: import/export txt files
« Reply #2 on: September 21, 2013, 06:55:27 am »
Hi,

have a look at thread http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1369750172 for a scripting example.

The help file downloaded from http://www.microsoft.com/en-us/download/details.aspx?id=2764 shows what can be done with scripting

Regards

Adler

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: import/export txt files
« Reply #3 on: September 30, 2013, 10:44:54 pm »
First, thanks a lot for your helpful replies.

The final solution for my problem is much more simple. I have browsed the EA local scripts and found a "File IO Example" script, which is have copy-pasted into an own script (since local scripts can not be altered) and adjusted to my own needs. Also, johann's link
(http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1369750172)
was handy.

The local scripts seem to be a nice starting point for straight forward solutions for EA-newcomers.

Greetings
Adler

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: import/export txt files
« Reply #4 on: October 01, 2013, 02:26:51 am »
You might also have a look in my Scripting book. There's a free sample downloadable.

q.