5.1.1. Filenames

<< Click to Display Table of Contents >>

Navigation:  5. Detailed description of the Actions > 5.1. General Parameters used in many actions >

5.1.1. Filenames

 

Many actions (e.g. the “CSV File reader/writer”, “Excel File reader”, “Anatella Gel File reader/writer”, etc.) require you to give a filename as parameter.

 

Inside Anatella, you can specify a path to a file in different ways. For example, if the Text/CSV file that you want to read is inside the same directory (or inside a subdirectory) as your currently edited Anatella-Graph file, then Anatella will automatically rewrites your path in a “relative way” (The re-written path is relative to the location of your current Anatella Graph File): You will see a ‘:’ character as the first character of your path: For example:

 

ANATEL~2_img4

 

 

In this example, the file “census-income.rar” is located inside the same directory as the Anatella-Graph file. Thanks to this functionality, the location of your Txt/CSV file is now relative to the location of your Anatella-Script. This allows you to easily copy/move your Script&Data into another directory. This functionality is interesting when you want to share with your colleagues your Anatella-Graphs because you never know in which directory your colleague will copy your Script&Data and it should still work properly.

 

Another way to specify the path to a file is to use a small bit of JavaScript code to compute the path. When you set the character “>”     as the first character of the filename, the “filename” is computed using JavaScript code. For example: This will open the file “subscriberProfile_part1_WP4.gel_anatella” that is located inside the directory “tmp_data” (The directory “tmp_data” is, itself, a direct subdirectory of the directory containing the Anatella-Graph-File):

 

ANATEL~2_img5

 

 

Another way to specify the path to a file is to use the wildcard character (i.e.: The “*”character)(Wildcard characters are only accepted in the filename, not in the directory-path). All the files matching the wildcard filter will be opened one after each other and their content will be concatenated together in one unique large output table. For example: This will open all the .csv files starting with “data_” inside the current directory (i.e. the directory from the Anatella-Graph-File). The content of all these files will be merged together (this is equivalent to using the “Append” ANATEL~2_img7 action to concatenate all these .csv files together):

 

 

ANATEL~2_img6

 

 

 

ANATEL~2_img8

When using the wildcard character (i.e.: “*”) inside a “readCSV” action, all the .csv files must contain exactly the same columns, in exactly the same order (not one more, not one less).