Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with *VREAD

Status
Not open for further replies.

harshn

Civil/Environmental
Feb 2, 2007
24
0
0
US
I am trying a small program to read some data into an array....but I am always gettin an error message can someone help me out with the instruction set..

*DIM,arr1,,2,3
*VRead,arr1(1,1),/nasfea/ANSYS_doc/dataval,prn,,JIK,3,2
(3F6.1)
*CFCLOS

the following data is stored in a file dataval.prn which is tab deliminated.

1.5 2.2 -23.1
1.5 2.2 -23.1

I get following error message :

"*VREAD error in data read"

Can some one help me out .. I am stuck

Regards
Harsh
 
Replies continue below

Recommended for you

Harsh,
The *VREAD command is a little picky about file format. After learning the hard way initially I've had great luck since using comma delimited files. Tab and space delimited files are more difficult to get to read correctly if they contain more than one entry per line. Using your input from above, I was able to duplicate your error. However, when I used commas between numbers it worked perfectly. If you're using Excel, export your data as a *.csv file which is comma delimited. Else, edit the file dataval.prn to the following and it should read perfectly.

1.5,2.2,-23.1
1.5,2,2,-23.1


Good luck,
-Brian
 
Hi Brian,

Thanks for you comments. That helped me in understanding my mistake. I am working on a Sun Solaris (IRIX OS) machine and using a CSV file solves my prblem on windows machine, but I am still facing the same error on SUN machine. Do you have any information regarding this?

I greatly appreciate your help.

Regards
Harsh
 
Status
Not open for further replies.
Back
Top