*SREAD

*SREAD, StrArray, Fname, Ext, --, nChar, nSkip, nRead
Reads a file into a string array parameter.

Compatible Products: – | Pro | Premium | Enterprise | Ent PP | Ent Solver | DYNA

Argument Descriptions

StrArray

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 128 characters. If the string parameter does not exist, it will be created. The array will be created as: *DIM,StrArray,STRING,nChar,nRead

Fname

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

Filename extension (eight-character maximum).

--

Unused field.

nChar

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

nSkip

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

nRead

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

Notes

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

Menu Paths

This command cannot be accessed from a menu.

Release 18.2 - © ANSYS, Inc. All rights reserved.