Searching \ for '[PIC]: File import problems' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=port
Search entire site for: 'File import problems'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: File import problems'
2002\07\18@155349 by Josh Koffman

flavicon
face
Hi all. I have some assembler code that was written on a Linux machine
for gpasm. I'm now trying to compile it using MPLAB. Problem is, I open
the main file, and try to build it, and I get this:
Error[125]   C:\PROGRA~1\MPLAB\PROJECTS\UNILINK\UNILINK.ASM 2 : Illegal
condition (EOF encountered before END or conditional end directive)
Note that this error occurs on line two of the file! At that point
everything is still in comments. I'm guessing this is a problem with
cr/lf or something to that effect. Any ideas on how to fix this short of
retyping the entire program?

Thanks,

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\07\18@160217 by Dale Botkin

flavicon
face
Might try unix2dos or an ASCII ftp transfer to substitute CR/LF for
newlines int he file.  MPLAB may be seeing it as one big line...  try
opening it in Notepad, that should show you.

Dale
--
"Curiosity is the very basis of education and if you tell me that
curiosity killed the cat, I say only the cat died nobly."
         - Arnold Edinborough


On Thu, 18 Jul 2002, Josh Koffman wrote:

> condition (EOF encountered before END or conditional end directive)
> Note that this error occurs on line two of the file! At that point
> everything is still in comments. I'm guessing this is a problem with
> cr/lf or something to that effect. Any ideas on how to fix this short of
> retyping the entire program?

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\07\18@161641 by Dipperstein, Michael

face picon face
> From: Josh Koffman [spam_OUTlistsjoshTakeThisOuTspam3MTMP.COM]
>
> Hi all. I have some assembler code that was written on a Linux machine
> for gpasm. I'm now trying to compile it using MPLAB. Problem
> is, I open
> the main file, and try to build it, and I get this:
> Error[125]   C:\PROGRA~1\MPLAB\PROJECTS\UNILINK\UNILINK.ASM 2
> : Illegal
> condition (EOF encountered before END or conditional end directive)
> Note that this error occurs on line two of the file! At that point
> everything is still in comments. I'm guessing this is a problem with
> cr/lf or something to that effect. Any ideas on how to fix
> this short of
> retyping the entire program?
>
> Thanks,
>
> Josh

If you already have the file on your Windows machine, you can use an
undocumented feature in the EDIT.COM to correct cr/lf problems.  Open your file
in EDIT.COM, insert and delete anything you want (I usually type space and
backspace).  Now save the file.  The file will
be saved with a cr/lf at the end of each line.

I know it's a lame way to get correct the problem, but it works.

-Mike

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\07\18@162946 by Scott Dattalo

face
flavicon
face
On Thu, 18 Jul 2002, Josh Koffman wrote:

> Hi all. I have some assembler code that was written on a Linux machine
> for gpasm. I'm now trying to compile it using MPLAB. Problem is, I open
> the main file, and try to build it, and I get this:
> Error[125]   C:\PROGRA~1\MPLAB\PROJECTS\UNILINK\UNILINK.ASM 2 : Illegal
> condition (EOF encountered before END or conditional end directive)
> Note that this error occurs on line two of the file! At that point
> everything is still in comments. I'm guessing this is a problem with
> cr/lf or something to that effect. Any ideas on how to fix this short of
> retyping the entire program?

Maybe it's just the GNU CopyLeft that begins at line 2?

If not, you can try dos2unix, unix2dos, or sed (my latest favorite).
You also can convert from dos to unix with pico. Maybe the window's
version of pico will go the other way?

Scott

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\07\18@164403 by doughemi

picon face
The excellent shareware editor TextPad  has a tool for fixing this sort
of problem.
MPLab had fits with programs written on my Mac until I ran them through
Textpad.

http://www.textpad.com/

--Doug

{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\07\18@165041 by Jeremy Walworth

flavicon
face
If you have access to a Linux box, get it back over there and do this:
cat yourfile.txt | todos > newfile.txt

todos and fromdos are some nifty Linux tools to get you there and back
again with the CR/LF stuff straightened out.

-J

At 04:15 PM 7/18/02 -0400, you wrote:
{Quote hidden}

Jeremy S. Walworth
"I fly, I sail, I throw caution to the wind"  -Jimmy Buffett
http://www.jeremyanddarcy.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\07\18@165454 by Peter L. Peres

picon face
On Thu, 18 Jul 2002, Scott Dattalo wrote:

>On Thu, 18 Jul 2002, Josh Koffman wrote:
>
>> Hi all. I have some assembler code that was written on a Linux machine
>> for gpasm. I'm now trying to compile it using MPLAB. Problem is, I open
>> the main file, and try to build it, and I get this:
>> Error[125]   C:\PROGRA~1\MPLAB\PROJECTS\UNILINK\UNILINK.ASM 2 : Illegal
>> condition (EOF encountered before END or conditional end directive)
>> Note that this error occurs on line two of the file! At that point
>> everything is still in comments. I'm guessing this is a problem with
>> cr/lf or something to that effect. Any ideas on how to fix this short of
>> retyping the entire program?
>
>Maybe it's just the GNU CopyLeft that begins at line 2?
>
>If not, you can try dos2unix, unix2dos, or sed (my latest favorite).
>You also can convert from dos to unix with pico. Maybe the window's
>version of pico will go the other way?

tr '\n' '\r' ?

Peter

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\07\18@215017 by Josh Koffman

flavicon
face
Thanks to all for their replies. This is the solution I ended up using,
mostly because I didn't want to transfer back to Linux, and I was too
lazy to download another program. I don't want to start editor wars
again, but I might think about switching to an editor that can also
provide context colour coding or something, if that even exists. I guess
I should really try out the MPLAB6 editor first though, no?

Thanks again,

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

"Dipperstein, Michael" wrote:
> If you already have the file on your Windows machine, you can use an
> undocumented feature in the EDIT.COM to correct cr/lf problems.  Open your file
> in EDIT.COM, insert and delete anything you want (I usually type space and
> backspace).  Now save the file.  The file will
> be saved with a cr/lf at the end of each line.
>
> I know it's a lame way to get correct the problem, but it works.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\07\19@040620 by Alan B. Pearce

face picon face
>I don't want to start editor wars again, but I might think
>about switching to an editor that can also provide context
>colour coding or something, if that even exists. I guess
>I should really try out the MPLAB6 editor first though, no?

Look seriuosly at Ultraedit, it has configuration files available for a very
wide range of formats, including the PIC.

http://www.ultraedit.com/

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body


2002\07\19@072527 by Michael Rigby-Jones

flavicon
face
> -----Original Message-----
> From: Alan B. Pearce [SMTP:A.B.PearcespamKILLspamRL.AC.UK]
> Sent: Friday, July 19, 2002 8:41 AM
> To:   .....PICLISTKILLspamspam.....MITVMA.MIT.EDU
> Subject:      Re: [PIC]: File import problems
>
> >I don't want to start editor wars again, but I might think
> >about switching to an editor that can also provide context
> >colour coding or something, if that even exists. I guess
> >I should really try out the MPLAB6 editor first though, no?
>
> Look seriuosly at Ultraedit, it has configuration files available for a
> very
> wide range of formats, including the PIC.
>
> http://www.ultraedit.com/
>
I'll second this.  UltraEdit is a very good editor, and IMO fantastic value
($35). Start using it and you'll never want to use the MPLAB editor again.

Scott Newell has also written a small (shareware) utility called "build.exe"
which enabled you to invoke the MPLAB build from an external program (such
as UltraEdit).   This allows you to use the project manager and build
facility of MPLAB, but edit and compile through UltraEdit with ease.  Take
alook at http://www.workingtex.com/htpic/PIC_tips_5.asp for details.

Regards

Mike

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspam_OUTspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body


2002\07\19@080358 by Olin Lathrop

face picon face
> Hi all. I have some assembler code that was written on a Linux machine
> for gpasm. I'm now trying to compile it using MPLAB. Problem is, I open
> the main file, and try to build it, and I get this:
> Error[125]   C:\PROGRA~1\MPLAB\PROJECTS\UNILINK\UNILINK.ASM 2 : Illegal
> condition (EOF encountered before END or conditional end directive)
> Note that this error occurs on line two of the file! At that point
> everything is still in comments. I'm guessing this is a problem with
> cr/lf or something to that effect. Any ideas on how to fix this short of
> retyping the entire program?

I bet you're right.  Unix stores LF to indicate new line, whereas Windows
stores CR LF.

I write all my host software on top of a portability layer.  As part of
that, the text file reading routines try to be tolerant of both methods.
All my top level programs can therefore read either file type, but they
produce the file type native to whatever system they are running on (built
for).

My COPYA program copies ASCII files while allowing a few operations on them
(converting tabs to spaces with arbitrary tab stops, etc).  Among other
things, the Windows version will automatically write the output file in CR
LF format.  The COPYA program is included in the "PIC development tools"
download at http://www.embedinc.com/pic/dload.htm.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body


2002\07\19@155241 by Welch, Ken

flavicon
face
if you can get the file to Wordpad in windows save the file as "MSDOS Text"

that will strip out the stray EOF

> Hi all. I have some assembler code that was written on a Linux machine
> for gpasm. I'm now trying to compile it using MPLAB. Problem is, I open
> the main file, and try to build it, and I get this:
> Error[125]   C:\PROGRA~1\MPLAB\PROJECTS\UNILINK\UNILINK.ASM 2 : Illegal
> condition (EOF encountered before END or conditional end directive)
> Note that this error occurs on line two of the file! At that point
> everything is still in comments. I'm guessing this is a problem with
> cr/lf or something to that effect. Any ideas on how to fix this short of
> retyping the entire program?

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...