PDA

View Full Version : filter2xml.pl prob



zagnut
01-13-2004, 04:44 PM
Heya. A few of my old seq4 filters files aren't correctly converted to the new seq format by filter2xml.pl. My seq4 filter file for solro tower is attached. Running it through filter2xml.pl results in section names like this:


[Hunt]
</section>
[Caution]
</section>
Also, a space and a ^M are added at the end of each mob's name:


<oldfilter><regex>Name:Galremos ^M</regex></oldfilter>
Any ideas?

Zaphod
01-16-2004, 07:23 AM
The problem turns out to be that your source files have a trailing space after the filter strings and also use windows (CRLF) line termination as opposed to UNIX line termination (LF). The CR appears as a ^M (aka control-M, ASCII 13). I'll make the next version of filter2xml.pl more robust in the face of such files.

Enjoy,
Zaphod (dohpaZ)

S_B_R
01-16-2004, 09:11 AM
Open your source files in vi. then enter
:%s/^M//gto make the ^M type Ctrl+V then Ctrl+M. That will get rid of the ^M's next enter
:%s/\ $//g that will get ride of the trailing spaces (there is a space after the "\"). finally to save the file and quit enter
:wq!

There maybe an easier way in vi but I'm not a vi guru, only been using it for about 9 years. ;)

zagnut
01-16-2004, 05:43 PM
Thank you both =)