×
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!

*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

WRITING AN EXCEL FILE FROM BASIC
2

WRITING AN EXCEL FILE FROM BASIC

WRITING AN EXCEL FILE FROM BASIC

(OP)
Hi Guys.

I want to create files that can be read directly as EXCEL files from a BASIC program running under DOS.

What I do right now , for example, is as follows:

1000 OPEN "O",1,A$ + ".RYD"
1005 WRITE #1, "X", "Y", "Z"
1010 WRITE #1,   P, Q, R
1015 CLOSE 1

This creates a file named A$.RYD with the data perfectly ok etc, but when trying to read it as an EXCEL file I have to do a bit of messing around to get the numbers to line up in cells properly.

It must be pretty simple to format the data to go directly into EXCEL.

Can anyone help please?

 
Replies continue below

Recommended for you

RE: WRITING AN EXCEL FILE FROM BASIC

From Basic,  Save as an .XLS file and then read as Fixed Width

RE: WRITING AN EXCEL FILE FROM BASIC

you can write the file as a "comma separated value" file, or .csv.  Excel will automatically read those.  Try exporting one from excel for an example.

RE: WRITING AN EXCEL FILE FROM BASIC

jwb46,

i gather u use the basic program to create the data needed by excel.  the process is fine.  excel will import the data; however, it helps if the source data (written by basic program) is a comma-seperated, semi-colon-seperated, or some other character seperated file.  when excel reads in the data, it will automatically seperate the data into rows and columns.

for example,
basic file contains:

1234567890

excel will import (delimit) the data as one complete number.

whereas, the basic file contains:

1,2,3,4,5,6,7,8,9,0

excel will import (auto delimit) the data into 10 columns, without having to resort to extra effort in seperating the data.

good luck.
-pmover

RE: WRITING AN EXCEL FILE FROM BASIC

(OP)
Thanks guys. Very helpful. I will experiment. Watch this space!
JWB46

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! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close