Does anyone know how to limit the width pf a plain text file to allow 65 characters max per line?
I am reading a text file, and once I Print # it back to a text file after making changes to it, the lines are too long and it don't wrap to the next line but instead the lines inside are very long in width. Perhaps a way to do word wrap?
I'm open a file and modifying it to remove "." at the front of each line, and to put a space in between each day.
Example:
CLS
OPEN "forecast.txt" FOR INPUT AS #1
OPEN "test.txt" FOR OUTPUT AS #2
WHILE NOT EOF(1)
INPUT #1, LineTxt
IF LEFT$(LineTxt, 1) = "." THEN
PRINT CHR$(13); CHR$(13)
PRINT #2, CHR$(13); CHR$(13)
PRINT MID$(LineTxt, 2); " ";
PRINT #2, MID$(LineTxt, 2); " ";
ELSE
PRINT #2, LineTxt; 'write output to new file test.txt
PRINT LineTxt; 'prints output to screen
END IF
WEND
CLOSE #1
CLOSE #2
The problem is, It open the file for input and make the changes, but when the output changes a written to the new file test.txt, the lines for each line are too long. I need to limit them to no more than 65 characters per line for what I'm needing to do. I have tried several thing using the col% and LEFT$ but can't get it to use no more than 65 characters per line before starting a new line.
I am attaching the text file for reference.
If anyone know how to resolve this please share any ideas you may have.
Any help is appreciated.
Thank you.
Kent
[ You are not allowed to view this attachment ]
[ You are not allowed to view this attachment ]