4. Examples#
4.1. Creating a table in “ASTER” format with IMPR_TABLE#
In this example (extracted from zzz128b), we write several tables in the format “ASTER” in a file.
TT= POST_RELEVE_T (ACTION =_F (INTITULE = “RESU_U2”,
NOEUD = (“B”, “C”, “D”, “D”, “E”, “F”,),
RESULTAT = U2,
NOM_CHAM = “DEPL”,
TOUT_ORDRE = “OUI”,
TOUT_CMP = “OUI”,
OPERATION = “EXTRACTION”))
IMPR_TABLE (UNITE =37,
TABLE =TT,
FORMAT =” ASTER “)
IMPR_TABLE (UNITE =37,
TABLE =TT,
FORMAT =” ASTER “,
NOM_PARA =( “NOEUD”, “INST”, “ABSC_CURV”,
“DX”, “DY”, “DZ”, “DRX”,)
)
4.2. Reading tables in “ASTER” format with LIRE_TABLE#
TT2 = LIRE_TABLE (UNITE =37,
FORMAT =” ASTER “,
NUME_TABLE =1,
TITRE =” VALIDATION FROM LIRE_TABLE “,)
TT_RED = LIRE_TABLE (UNITE =37,
FORMAT =” ASTER “,
NUME_TABLE =2,
TITRE =” VALIDATION FROM LIRE_TABLE “,
)
4.3. Reading a table in LIBRE format#
For example, let’s say a table like this one in OpenOffice Calc:
It is saved in text format (format CSV) with the semicolon as column separator and without surrounding character strings (without text separator).
The following text file is obtained:
Table produced in OpenOffice;
saved in CSV format with the semicolon as a separator;
and without a text separator;
;;
Column A; Column B; Column C
label1; 111; 0.09
name 2; 222; 10,09
value 3; 444; 2240.18
example 4; 888; 994640,73
line 5; 1776; 883240965,82
To read it in Code_Aster, you can do:
tab = LIRE_TABLE (UNITE =55,
FORMAT =” LIBRE “,
SEPARATEUR =”; “,)