WYAE - FWTOOLS Mailing List Archive


RE: [fwtools] Suggestion - Null Values in Templates
From:"WISNIEWSKI, DANIEL (SBCSI)"
Date: Wed, 20 Oct 2004 08:01:58 -0400

Yes, I took Reto's advice and it is working great.
=20
However I did decide to use the  Gnu SED=20
=20
sed -u -e "s/||$/|NULL|/"

	Thank you all once again
	     dan wisniewski
	     Michigan USA=20
	=20
	=20
	 -----Original Message-----
	From: Volker Tanger [mailto:volker.tanger@wyae.de]=20
	Sent: Tuesday, October 19, 2004 4:44 PM
	To: fwtools@wyae.de
	Subject: Re: [fwtools] Suggestion - Null Values in Templates
=09
=09


	Greetings!
=09
	On Thu, 7 Oct 2004 19:48:02 +0200
	Reto Schuettel  wrote:
=09
	> > I use Templates to Load into MySQL
	> Hm, you could use the templates for creating sql code directly
:)?
=09
	*grin* you were faster than me with this comment...  ;-)
=09
=09
	> > Accordingly, at times I need to find fields that have "null"
(
	> > empty) values.=20
	> >=20
	> > Perhaps a change in code around line 3267
	> >
	> > ## For DB Nulls
	> >         if ( $access_comment[$i] ) {
	> >         $line =3D~ s/<<>>/$access_comment[$i]/g;
	> >         }  else {
	> >         $line =3D~ s/<<>>/NULL/g;
	>
	> Hm, in my opinion this solution is quiet ugly, because it
breaks
	> everything :). You have to implement that as an optional
parameter,
	> like--print-nulls or something like that, you should never
change the
	> default behavior!
=09
	Seconded. But another otion added onto that bunch of what we
already
	have today? I'd prefer... (below)
=09
=09
	> # perl -i -pe 's/\t\t/\tNULL\t/g' output.tsv # these both
commands
	> # perl -i -pe 's/\t\n/\tNULL\n/g' output.tsv # replaces all
the empty
	>                                              # strings with
NULL
=09
	As you're (probably) massaging the TSV file with a Perl script
anyway
	replacing "" with "NULL" should not be so much of a problem - I
hope?
=09
	As NULL only has this one special meaning in connection with
MySQL it
	will not be compatible with (any) other projects using FW1Rules'
output.
	So I'd prefer to stay with the "just empty as it is" way.
=09
	Bye
	        Volker
=09
=09
	--
=09
	Volker Tanger   volker.tanger@wyae.de
	=
-=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D-
	Research & Development Division, WYAE
=09
=09
	--- StripMime Report --
	Plain text mail. Excellent! Won't be converted or stripped.
	---
=09
	----------------------------------------------------------
	FireWallTOOLS-Mailinglist                  fwtools@wyae.de
	----------------------------------------------------------
	to unsubscribe send a mail to: minimalist@wyae.de with the
	subject: unsubscribe fwtools=20
=09
=09



--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---