Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Any on ideas on how I can solve these 2 write file probs I have?

Author
Message
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 15th Nov 2003 13:01 Edited at: 15th Nov 2003 13:12
Hi

I'm writing a program at the moment which reads a tabbed delimited txt file created in excel. It has about 20 columns and each column has many characters in. At the moment it reads the file and stores each bit of data in every column in a dim array then writes out to another file. But the problem I've come across is I can't write all 20 strings on one line as I get a string overflow error.

I can group say 5 columns to one string before the string gets too big which is fine, but when I write to file I can't write each string after the next on the same line. So...

write string 1, cset1$
write string 1, cset2$

would write both strings on seperate lines, but the program I would be using this output file on has to have all the information on one line otherwise it will treat each line as the next record.

Also I can't seem to write tabs to file. Is this possible? Tabs come out as spaces in the output file. I've tried a tab between quotes " " which just prints out spaces. And a slash before a t between qoutes "\t" (a way to tab in some other languages) which just prints out the slash and t between qoutes "\t"

I look forward to any ideas that any of you might have that might help

Thanks

Kevin
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 15th Nov 2003 16:17
For the single line writing, im not too sure... I have come up against this problem previously, and had to work around it...

But, for the tab...

you need to write the ascii equivelant of tab, which is 9... to do this:



Hope I Helped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 17th Nov 2003 13:29
Thanks for your help on the tabbed problem, I set up a string to equal ascii character 9 and then just used that string whenever needed which works a treat.

Cheers for that

Kevin
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 18th Nov 2003 07:50
That's cool... Just trying to help out


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy

Login to post a reply

Server time is: 2025-05-21 19:35:42
Your offset time is: 2025-05-21 19:35:42