Data, files and processes

Seven lessons on the work a script does around a program: reading and writing files, starting a process and collecting its output, parsing and writing JSON and XML, the YAML and TOML that ship with the language, regular expressions and dates, and the honest limits of SQL and HTTP in an image without a driver.

8.1 Files and eachLine write, read, append, walk a folder, and the File methods the GDK adds Open 8.2 Processes from Groovy 'ls'.execute(), the streams of a process, and the exit status it returns Open 8.3 JSON with JsonSlurper and JsonOutput parse a document, read nested values, and write JSON back Open 8.4 XML with XmlSlurper and MarkupBuilder read a document with GPath, and build one element at a time Open 8.5 YAML and TOML two formats Groovy reads and writes out of its own lib Open 8.6 Regular expressions and dates slashy patterns, groups, replaceAll, and the date types of the JDK Open 8.7 SQL and HTTP what groovy.sql needs, and honest failures for the drivers this image does not have Open

Lessons