I am having trouble reading a text file and having it stay as text. I guess skill expects every text item to be quoted.Is there a way I can read it as text?
second choice: can I split each line into an Array?
775 640 N74011018 TP30CIR_TOP Top5045 570 N74011128 TP30CIR_TOP Top 5175 1015 GND TP30CIR_TOP Top 55 1310 GND_EARTH TP30CIR_TOP Top 650 140 VOUT TP30CIR_TOP Top 500 140 MODEM_48VIN- TP30CIR_TOP Top 500 190 MODEM_48VIN+ TP30CIR_TOP Top 75 595 48VIN- TP30CIR_TOP Top 775 1190 48VIN+ TP30CIR_TOP Top
(defun Read_String () FileData=infile("sample_infile.txt") LocLine=""
while( LocLine!=nil LocLine=lineread(FileData)
printf("%n %n %L\n" nth( 0 LocLine) nth( 1 LocLine) nth( 2 LocLine))
Skill > Read_String775 640 N740110185045 570 N740111285175 1015 GND55 1310 GND_EARTH650 140 VOUT500 140 (MODEM_48VIN - TP30CIR_TOP)500 190 (MODEM_48VIN + TP30CIR_TOP)E- E- 75 595 48VIN- TP30CIR_TOP Top E- ^E- SYNTAX ERROR found at line 8 column 13 of file sample_infile.txtE- *Error* lineread/read: syntax error encountered in inputERRORSkill >
Things of note:
1. The minus and plus sign in MODEM_48VIN- and MODEM_48VIN+ gets separated in the output, and that makes a list of two items: (MODEM_48VIN - TP30CIR_TOP)2. Program chokes on 48VIN- maybe because it starts with a number and ends with a minus sign.
I found the problem. The text file had some empty lines at the end. Yes, I have to put a check for that.
Thanks for Your help Dave!