Chapter 15

Working with Files

You have files all over your hard drive. Some files are quite specific. For example, when you open an IDEA database, you're opening a file. Likewise, when you open Microsoft Excel to see some data you exported from IDEA, you're opening a file. These specific kinds of files don't require any special processing because IDEA already has functionality built into it to handle them. However, you might encounter files that are unique in some way—they might not even contain data that you analyze, but rather contain information of a different sort—perhaps configuration information for your application. IDEAScript can work with these kinds of files too! All you need to do is provide a little code to tell IDEAScript what to do with the file. This chapter is all about working with these special kinds of files.

Considering the File Format

Your hard drive contains many different kinds of files. Some of the files are executables, which are completely unreadable by humans. A few of the files contain pure text data, which is easily read by humans using a simple editor such as Notepad. Many of the files are a mix of readable and unreadable information. For example, you can open an XML file in Notepad and probably figure out what the XML means, but it isn't as easy to understand as pure text. Files, such as those created by Microsoft Word and Microsoft Excel, contain readable information, but the unreadable information mixed with it makes it hard for most people to ...

Get Mastering IDEAScript: The Definitive Guide, with Website now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.