finding files in dos format + .sql files without an empty last line

Warren Head warrenhead at gmail.com
Thu Feb 22 02:01:59 PST 2007


2007/2/22, Simon Geard <delgarde at ihug.co.nz>:
>
> On Wed, 2007-02-21 at 23:54 +0200, Ag. Hatzimanikas wrote:
> > Do you want to find files in dos format and with an empty line at the
> > end?
> > Do you want the opposite? (without an empty line)
> > Do you want to append an empty line at the end to the converted files?
> > Do you want to delete (if any) the empty last line to the converted
> files?
>
> I think it's a question of whether the line-end character marks the end
> of every line, or whether it separates two lines. I've seen programs
> that parsed a file and ignored the last line if it didn't end in a
> new-line character. Sounds like that's what Warren is encountering here,
> separate from the DOS/Unix format issue.
>
> I guess what we're looking for is a list of files for which the last
> character of the file is a LF. Not sure how you'd do that, since grep
> would presumably just ignore LF characters - you can't exactly match on
> them, can you?
>
> Simon.


I am not sure where the LF should be placed, but I guess that to be on the
safe side an extra LF at the end wouldn''t hurt.
The files that are causing trouble are of two types. Some have been read by
people on windows machines and turned into dos syntaxed files. These files
are pretty much ignored entirely by the DBMS. Regardless of what it
contains.
Some files however are still unix syntaxed files, but because the last line
of the file is (somehow no longer) empty, this last line is no longer
executed by the DBMS. Basically this makes the DBMS ignore the last line.
Usually the last line is an sql index statement, so the DBMS will work on,
but a lot slower.

I hope you guys can find something out,

Cheers, Warren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfromscratch.org/pipermail/blfs-support/attachments/20070222/e0f03522/attachment.html>


More information about the blfs-support mailing list