×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

problem with *VREAD

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

RE: problem with *VREAD

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

RE: problem with *VREAD

Sorry, the data should read:

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

(OP)
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

RE: problem with *VREAD

Try saving the file in UNIX instead of DOS format.  Hopefully your text editor has this capability.

RE: problem with *VREAD

(OP)
Thanks

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources