[ale] another darn sed/awk question

Christopher Bergeron christopher at bergeron.com
Thu Jul 24 11:45:17 EDT 2003


The relevant part is simply:  

awk '{ print substr($0,0,7) $1 $2 }' filename.txt

but in my application I used:

awk '{ print "INSERT INTO table VALUES (\"" substr($0,0,7) "\","" $2 
"\",\"" $1 "\");"}' filename

Which brings up another more difficult question:
Does anyone know how I can md5sum a field using AWK?!?

I'd like to md5sum the first field before inserting it into a mysql 
database.  Would it be easier to use password() in mysql to do this?

Any takers?

Thanks,
CB



Jason Etheridge wrote:

> On Thursday, July 24, 2003, at 11:17 AM, Christopher Bergeron wrote:
> >Nevermind, I figured it out.
> >
> >Figures!
> >
> >Grrr...
>
> But you didn't show us what you did.  Now I have to figure it out. *8)
>
> -- Jason
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
>
>


_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale





More information about the Ale mailing list