BBC BASIC for Windows
Programming >> Database and Files >> Comma delimited files
http://bb4w.conforums.com/index.cgi?board=database&action=display&num=1382700318

Comma delimited files
Post by dje4816 on Oct 25th, 2013, 11:25am

I have saved a .dat file containing just numbers. I want to import this into Excel for further processing as a comma-delimited file. But the file contains gibberish - a load of symbols instead of my numbers.

Can anyone advise me how to keep this in the format I wrote to file, please?

Dave.
undecided
Re: Comma delimited files
Post by admin on Oct 25th, 2013, 1:18pm

on Oct 25th, 2013, 11:25am, dje4816 wrote:
I have saved a .dat file containing just numbers. I want to import this into Excel for further processing as a comma-delimited file.

A good format to use, which will be understood by Excel, is CSV (Comma Separated Value). This Wiki article describes how to read and write CSV files in BBC BASIC:

http://bb4w.wikispaces.com/Reading+and+writing+CSV+files

The routines listed there assume that the data will be contained in a 2-dimensional string array, which is a good way of representing spreadsheet-style (row and column) data.

However, since CSV files are basically just plain-text files you can choose to read and write them in other ways if you wish. This article may be helpful:

http://bb4w.wikispaces.com/Reading+and+writing+plain+text+files

Richard.
Re: Comma delimited files
Post by dje4816 on Nov 8th, 2013, 1:09pm

Many thanks, Richard. Sorry to be a bit tardy coming back on this one.

Best regards,

Dave.
smiley