XANSYS Message: 40997 [Go back to message list] [bookmark on del.icio.us]
No rating yet Subject: Re: [APDL] *vread with mixed character/number array Author: Bob Weathers Date: 2002-08-22 09:38:00Hi Joe,
I do something similar when importing CFD results into ANSYS so I can map them onto my FE mesh. The guys feeding me the data use '!' as the first character in row 1 if that line is a comment. I also conclude the file with '/EOF' so I can count lines and know how many rows of data there are.
My strategy is similar to ashok's.
1. Dimension a string array to, say, 9999 lines of 128 or 256 characters or whatever.
2. Read in the data 9999 lines at a time until you hit the '/EOF'. If you have a really big file, you might have to loop.
3. Parse the lines in the string array and pitch out the ones you don't want.
4. Write the 'keepers' into a NewFile.dat in %C format.
5. Read NewFile.dat into ANSYS using %G or whatever.
It takes awhile to set it up but it is pretty fast. I've always worried about dimensioning these large arrays and releasing them back to the HEAP by deleting them when done. I've never had a problem though - seems like it works ok.