| | ASCII File Conversion Unix/NT
It seems that Unix and NT use different hidden control characters to terminate
lines in text files.
Symptoms:
 | When running a Program File, this causes I-DEAS to error out with incompatible control
characters. You will get the
message "System read error on line 1 of command input file". |
 | When importing a Universal File, I-DEAS will act like it's reading
all the lines, but report that "x" lines have been read and
"0" processed. |
There are
some workarounds that will convert the control characters and get the file so that it will
read on your system.
Running on Windows NT
If you're running on Windows NT and using a file that exhibits the error message
above, then it is very likely that the program file originated on a Unix system.
Although a bit convoluted (and there may be better/easier ways to do this, but I haven't
found them yet), you can use the following approach to workaround the problem.
 | open the program file in a text editor, e.g. Notepad
 | Select All, Copy |
 | Exit the text editor |
|
 | Launch Microsoft Word and open a new, empty document
 | Paste -- you should now have all the desired program file text in Word |
 | Select All |
 | set the Font to Courier New and the Fontsize to very small (say 8 pt) |
 | move the righthand Ruler as far to the right as possible -- the purpose here is
to make sure that no lines wraparound |
 | visually check to make sure that no lines have wraparound and that no blank lines
exist |
 | Save-As, Save as type = Text only with line breaks...
"your-desired-name.prg" |
|
Or, Ken
Mcintyre of Dart Container offers the following approach:
 | rename your program file to "program.old" |
 | in ideas, create a new program (e.g. "program.prg") and do
anything in it. |
 | In Wordpad
 | open "program.prg" with Wordpad and delete EVERYTHING. |
 | open "program.old" with Wordpad, select
everything(cntrl-A) and
copy it (cntrl-C) |
 | switch to "program.prg" and paste the file in
(cntrl-V) |
 | save program.prg as type "Text" |
|
Ken also makes the following further observations:
 |
Reading Text Files into I-DEAS (from I-DEAS "readme"
file)
"The I-DEAS software requires a carriage-return (<CR>) at the end of
ASCII text (*.txt) files, so be sure to press <Return> at the end of the last line in the file if you use Notepad or other editors to edit
an I-DEAS text file (and ALWAYS "Save As" a text file)." |
 |
What I found was that:
 |
this program file will give you the "system read
error on line 1" error message:
---------------------------------------
K : #OUTPUT "I'm Here"
E :
---------------------------------------
|
 | but this will not:
---------------------------------------
K : #OUTPUT "I'm Here"
E :
---------------------------------------
(Notice the extra blank line at the very end) |
|
Running on Unix
In this event, it is likely that the program file or universal file was created on Windows and
includes hidden "control-M" characters at the end of each line. You can
use a script (typed from the Unix command line) to remove these control characters:
 | For Program Files: |
perl -pi.bak -0777 -e 's#\r##gi'
filename.prg
(where "filename" is the name
of your file)
 | For Universal Files: |
perl -pi.bak -0777 -e 's#\r##gi'
filename.unv
(where "filename" is the name
of your file)
|