File Functions in DIAL

The file functions in DIAL perform various local file manipulations, including writing to local files.

Example 1:

This example demonstrates the action required to open a file called output.txt.

file.open(file,"../data/output.txt","write, delim=comma");

 

Example 2:

This example concatenates two files into one destination file, which is listed last.

file.concat(file.concat("../data/output.txt", "../data/20090212.txt", "../data/new_file.txt");

 

Example 3:

This example removes a file named revbymgr.txt from the local file system

file.remove("../temp/revbymgr.txt");

 

Example 4

This example opens a file named output.txt and writes in the values a1, b1, c1, a2, b2, and c2 to the file, stored in the object variable file. The values are separated by the current delimiter, which is a comma.

file.open(file,"../data/output.txt","write,truncate,delim=comma");

file.write_fields(file,"a1","b1","c1");

file.write_fields(file,"a2","b2","c2");

file.close(file);