ansys.mapdl.core.Mapdl.sread#

Mapdl.sread(strarray='', fname='', ext='', nchar='', nskip='', nread='', **kwargs)#

Reads a file into a string array parameter.

Mechanical APDL Command: *SREAD

Parameters:
strarraystr

Name of the string array parameter which will hold the read file. String array parameters are similar to character arrays, but each array element can be as long as 248 characters. If the string parameter does not exist, it will be created. The array will be created as: *DIM,StrArray,STRING,nChar,nRead

fnamestr

File name and directory path (248 characters maximum, including the characters needed for the directory path). An unspecified directory path defaults to the working directory; in this case, you can use all 248 characters for the file name.

extstr

Filename extension (eight-character maximum).

ncharstr

Number of characters per line to read (default is length of the longest line in the file).

nskipstr

Number of lines to skip at the start of the file (default is 0).

nreadstr

Number of lines to read from the file (default is the entire file).

Notes

Warning

This function contains specificities regarding the argument definitions. Please refer to the command documentation for further explanations.

Argument Descriptions

  • strarray : str - Name of the string array parameter which will hold the read file. String array parameters are similar to character arrays, but each array element can be as long as 248 characters. If the string parameter does not exist, it will be created. The array will be created as: *DIM,StrArray,STRING,nChar,nRead

  • fname : str - File name and directory path (248 characters maximum, including the characters

needed for the directory path). An unspecified directory path defaults to the working directory; in this case, you can use all 248 characters for the file name. * ext : str - Filename extension (eight-character maximum). * nchar : str - Number of characters per line to read (default is length of the longest line in

the file).

  • nskip : str - Number of lines to skip at the start of the file (default is 0).

  • nread : str - Number of lines to read from the file (default is the entire file).

The sread command reads from a file into a string array parameter. The file must be an ASCII text file.