XANSYS Message: 41013 [Go back to message list] [bookmark on del.icio.us]
No rating yet Subject: Re: [APDL] *vread with mixed character/number array. Author: John Swanson Date: 2002-08-22 14:54:00My immediate thought was "Nope, can't do that because ansys uses the system read with the user supplied format statement". However, the clever suggestions contained here might offer some hope, especially with the c formats. Can someone help me understand better what is desired. Is it as simple as ignoring any lines which contain characters? Or do we need to ignore lines which contain characters in columns which are supposed to contain numbers? If we were to read the entire line as a character string, then decode it internally, what would the maximum line length be? Would a fixed limit like 128 of 640 (slower) be acceptable? Comments, anyone? John Swanson Swanson Analysis Services, Inc.
> -----Original Message----- > From: Joe Metrisin [SMTP:jmetrisin@t...] > Sent: Thursday, August 22, 2002 2:34 PM > To: 'xansys@yahoogroups.com' > Subject: [xansys] Re: [APDL] *vread with mixed character/number > array.
> Many thanks to Ashok, Gordon, Bob, and others for their clever > workarounds. > Since we are writing macros to automate repetitive procedures, it would be > nice if ANSYS had the ability to ignore characters during *VREAD. For now > we are stuck with slow workarounds, or additional processing outside of > ANSYS.
> Regards,
> Joe Metrisin > Florida Turbine Technologies, Inc.
> Date: Thu, 22 Aug 2002 19:04:51 +0530 > From: Ashok > Subject: Re: [APDL] *vread with mixed character/number array.
> Though not terribly efficient ...
> If the numbers are not going to have more than 8 characters, then I would > read in the whole thing as chars and > then use VALCHR() to convert to numbers
> So that would mean "mask_" dimensioned as "char" > and the format for *VREAD would be "(A8)"
> If you use Ansys5.7 or higher, then your number could be longer and you > could use the C format specifications > to *VREAD to read in longer strings and then use VALCHR.
> Thanks,
> Ashok > EACoE, Bangalore
> Joe Metrisin wrote:
> > Greetings,
> > Does anyone know of a way to *VREAD a column of data that may have a few
> > rows with characters? ANSYS will abort the *VREAD if it encounters any > > characters in the column. Even using a mask vector to tell ANSYS to > skip > > the character rows does not work. I want ANSYS to ignore the character > rows > > and just read the numbers.