| |
Dr.Science
Registered: Oct 2011 Posts: 41 |
import of .txt files KickAss
Hi there. Just trying with CrossDev, and I run into a Problem...
Let's say I have a "file.txt" which is a file with some text like this:
Hello Everybody
I am a Little text...
Here Ends the text
No line is >40 chars (to fit C64 Screen). When I Import the file with
.import text "text.txt"
All SPACES and ENTERS are gone. How do I Import a file correctly with KICKASSEMBLER so that it fits the C64 Screen?
Thanks in advance.... |
|
| |
Slammer
Registered: Feb 2004 Posts: 416 |
The text import was made for doing scroll texts so it doesn't format the input for a 40x25 screen. Im surprised that your spaces are gone. It worked fine for me like in the scroll text for these productions:
Kick Assembler Easter Egg
GOLC
If you have to import many screens you could implement a macro that does it (Import a binary file and format the output so it suits your needs.) |
| |
Dr.Science
Registered: Oct 2011 Posts: 41 |
Sorry - you're right, the SPACES are not gone. It is just, I have not SPACES in each row to fill up to 40chars.
This works:
01234567890123456789012345678901234567890
This is a short text...SPACESPACESPACESPA (<--filled up with SPACE)
This fails:
01234567890123456789012345678901234567890
This is a short text...
Ofcourse it fails, because it has no spaces at the end of the text. (now I see it!)
As I have a LOT of text and screens, I need something automatic. How do all those MAG-EDITORs out there convert their text? Or the guys writing DOCS for games? Any hint?
thanks |
| |
Cresh
Registered: Jan 2004 Posts: 354 |
Maybe it has something to do with .txt file encoding? |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
Do a KickAss script that inserts the missing spaces, or even better, a c64 routine that does it when displaying the text, so it doesn't fill up unnecessarily. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
i'd just use petscii for the text in memory, no need to keep these trailing spaces anywhere, what a waste :) |
| |
Total Chaos
Registered: Mar 2006 Posts: 74 |
..well, you could also manipulate the original file, if you run Linux (or unix) AWK is your friend :)
awk '{printf "%-40s\n",$0}' infile.txt > outfile.txt
%-40 = up to column 40 (so it might need to be 39 ;)
\n adds a trailing linebreak
$0 is what char to pad the line with ($0 being space) |