directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <>
Subject Re: invalid .ldif? [newbie]
Date Sat, 04 Jul 2009 13:46:37 GMT
Brian Burch wrote:
> Jonathan Camilleri wrote:
>> I've just loaded an .ldif file within Apache Directory Studio and the 
>> program is pointing out /Unexpected token/.  I can't see anything 
>> wrong with the file, any ideas pls?
> Don't know about apache studio, but I've often had this sort of error 
> with command line ldapmodify when I've copied a windoze or os2 based 
> ldif file to unix and then updated it there. In almost every case, 
> I've tracked it down to a cr/lf problem.
Unlikely ...

Otherwise, there are many potential traps :

* no space after the ':' or '::'
* a  multi-line value not starting with a space
* an attribute type with a non valid char in it
* a missing ':'
* a missing RC at the end of the file (not sure if it still generates an 
* the #version:1 does not contain the valid '1' number

Without the file, it's hard to say ...

> If this is possible in your case, edit the file under linux; go to 
> EVERY single end-of-line position and delete characters until the next 
> line concatenates with the current one; hit return. (repeat for every 
> line, including the last empty line).
A trick on linux/unix, to remove window$ ^M : open your file in vi, and 
type :%s/^V^M// in command mode
(to produce the ^V, just hit the control key and the V key. The very 
same for ^M). Doing the same with sed should also work...

cordialement, regards,
Emmanuel L├ęcharny

View raw message