XANSYS Message: 40995 [Go back to message list]
No rating yet
Rate item:

Subject: Re: [APDL] *vread with mixed character/number array.
Author: Ashok
Date: 2002-08-22 09:34:00

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.

> Below is a snippet to illustrate the problem:

> Data file:

> aaaaaaaaabbbbbbbb
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 10

> Macro:

> *dim, mask_, array, 10
> *vfill, mask_(1), ramp, 0.

> *do, i_, 2, 10, 2
> mask_(i_) = 1
> *enddo

> *dim, data_, array, 10
> *vmask, mask_(1)
> *vread, data_(1), 'junk.dat'
> (f20.0)

> Thanks.

> Joe Metrisin
> Florida Turbine Technologies, Inc.


Posts possibly associated with message #40995AuthorDateScore
40991[APDL] *vread with mixed character/number array.Joe Metrisin2002/08/22 
40992Re: [APDL] *vread with mixed character/number array.Dave Conover2002/08/22 
40993Re: [APDL] *vread with mixed character/number array.Peter Frei2002/08/22 
40994Re: [APDL] *vread with mixed character/number array.Joe Metrisin2002/08/22 
40995Re: [APDL] *vread with mixed character/number array.Ashok2002/08/22 
40996Re: [APDL] *vread with mixed character/number array.Gordon May2002/08/22 
40997Re: [APDL] *vread with mixed character/number arrayBob Weathers2002/08/22 
40998Re: [APDL] *vread with mixed character/number array.Peter Frei2002/08/22 
40999Re: [APDL] *vread with mixed character/number array.Ian Prentice2002/08/22 
41002Re: [APDL] *vread with mixed character/number array.Don Shaffer2002/08/22 
41011Re: [APDL] *vread with mixed character/number array.Joe Metrisin2002/08/22 
41013Re: [APDL] *vread with mixed character/number array.John Swanson2002/08/22 
41014Re: [APDL] *vread with mixed character/number arrayBob Weathers2002/08/22 
41077Re: [APDL] *vread with mixed character/number array.Joe Metrisin2002/08/26 
41079Re: [APDL] *vread with mixed character/number array.John Swanson2002/08/26 
41080Re: [APDL] *vread with mixed character/number array.Ashok2002/08/26 
41083Re: [APDL] *vread with mixed character/number array.John Crawford2002/08/26 
41084Re: [APDL] *vread with mixed character/number array.Bob Weathers2002/08/26 
41086Re: [APDL] *vread with mixed character/number array.Ashok2002/08/26 
41093Re: [APDL] *vread with mixed character/number array.John Crawford2002/08/26 
41101Re: [APDL] *vread with mixed character/number array.Joe Metrisin2002/08/26 
41103Re: [APDL] *vread with mixed character/number array.Eric Miller2002/08/265
41106Re: [APDL] *vread with mixed character/number array.Fernand Thomassy2002/08/26 
41110Re: [APDL] *vread with mixed character/number array.Eric Miller2002/08/26 
41112Re: [APDL] *vread with mixed character/number array.Dan Bohlen2002/08/26 
41126Re: [APDL] *vread with mixed character/number arrayBob Weathers2002/08/26 
41161Re: [APDL] *vread with mixed character/number arrayJohn Swanson2002/08/27 
41162Re: [APDL] *vread with mixed character/number arrayBob Weathers2002/08/27 
41178Re: [APDL] *vread with mixed character/number arrayJohn Swanson2002/08/27 
41213Re: [APDL] *vread with mixed character/number arrayJohn Swanson2002/08/28 
41216Re: [APDL] *vread with mixed character/number arrayMartin Liddle2002/08/28 
41237Re: [APDL] *vread with mixed character/number arrayBob Weathers2002/08/28 
41239Re: [APDL] *vread with mixed character/number arrayJohn Swanson2002/08/28 
41242Re: [APDL] *vread with mixed character/number arrayJoe Metrisin2002/08/28 
41271Re: [APDL] *vread with mixed character/number arrayFernand Thomassy2002/08/29 
41273Re: [APDL] *vread with mixed character/number arrayJohn Swanson2002/08/29