problem with *VREAD
problem with *VREAD
(OP)
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
*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





RE: problem with *VREAD
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
RE: problem with *VREAD
1.5,2.2,-23.1
1.5,2.2,-23.1
I had a comma in there where there should have been a decimal.
RE: problem with *VREAD
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
RE: problem with *VREAD
RE: problem with *VREAD