DOS CR/LF in .MAP and .SYM files

Stephen Lime steve.lime at dnr.state.mn.us
Thu Jul 6 13:05:26 PDT 2000


This is fixed in 3.3.011 and the fix applies to map and symbol files. Geotiff
world and font set files will still need conversion since they are not parsed 
by the lexer.

Steve

Stephen Lime
Internet Applications Analyst

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> Peter deVoil <devoilp at dpi.qld.gov.au> 07/05/00 06:57PM >>>
Hi,

I did this in an earlier version by telling the lexer to ignore "\r"
characters, I'm guessing the 
newer syntax would require adding a line something like
---
<INITIAL>\r                             {}
---
to maplexer.l

Of course, if you use cygwin, it does the translation automatically.
Yours,
PdeV.


"Jim T. Bowen (GAIA Consultants Inc.)" wrote:
> 
> Hi Daniel and others,
> 
> This is a common one (we were nailed by it too when we first began).  I
> like your idea to modify the parser, but I cannot offer much help.  Here
> are some alternate pointers for those interested:
> 
> * use a decent ftp programme that strips/adds CR to LF (most popular
> programmes do this for you)
>   * don't forget...if you zip the files before transferring, your ftp
> prog. will *not* alter the newline characters
> 
> * if you are running SAMBA, remember that text files are *not* modified
> by default
>   * use a text editor like UltraEdit (or equivalent) and convert your
> files once they are on your SAMBA drive or write your files from ArcView
> with only LF (or vice-versa)
> 
> * run a script on your files each time they are transferred
>   * in ksh, run SED (e.g., sed "s/$/`echo -e \\\r`/")  [convert Unix LF
> to CR/LF]
>   * in ksh, run SED (e.g., sed 's/.$//') [convert CR/LF to Unix
> LF...this assumes all lines end in CR/LF]
> 
> I know this is not what you were looking for, but hopefully it may help
> some.
> 
> Cheers,
> Jim
> 
> Daniel Morissette wrote:
> >
> > Hi,
> >
> > Is there any way that the MapServer .MAP and .SYM parser could be
> > modified so that it is not sensitive to the difference between DOS and
> > Unix linefeeds.
> >
> > It looks to me like every new MapServer user goes through the following
> > error message when they try to get MapServer running the first time:
> >
> >     msLoadSymbolFile(): Unknown identifier. ( ):(0)
> > or
> >     msLoadMap(): Unknown identifier. ( ):(5)
> >
> > and most of the time, it's because MapServer is running on Unix and the
> > .MAP or .SYM file contains DOS ^M chars... either because the original
> > file came from Windows, or because a Windows tool was used to extract
> > the archive and then copy the files to Unix.
> >
> > I'm not a flex/bison expert, so I don't know if it's easy to fix...
> > Anyone has ideas?
> > --
> > ------------------------------------------------------------
> >  Daniel Morissette                       danmo at videotron.ca 
> >               http://pages.infinit.net/danmo/ 
> > ------------------------------------------------------------
> >   Don't put for tomorrow what you can do today, because if
> >       you enjoy it today you can do it again tomorrow.
> 
> --
> _______________________________________
> In order to reduce SPAM (i.e., junk
> e-mail), all e-mail to me must include
> the following somewhere in the body
> of the message:        J*I*M
> _______________________________________
> 
> _______________________________________
> Jim T. Bowen, M.Sc., President
> 
> Suite 306,  822-11th Ave. S.W.
> Calgary, Alberta, Canada  T2R 0E5
> Ph: 403-571-7213   Fax: 403-571-7211
> bowenj at gaiaenv.com 
> 
> http://www.gaiaenv.com 
> _______________________________________




More information about the MapServer-users mailing list