On Fri, Feb 11, 2005 at 04:55:12PM -0500, Rick Root wrote:
> Hey can someone write me a regex for use with sed that converts
> 2005-01-01-05-00-00.000000
> 
> to
> 
> 2005-01-01 05:00:00.000000
> 
> Muchas gracias... I'm converting some data files that I use to import 
> data into Oracle into files suitable for importing into SQL Server using 
> Bulk Insert, and SQL Server doesn't like the original format.

Using awk, this would be:

awk -F'-' '{ printf( "%s-%s-%s %s:%s:%s\n", $1,$2,$3,$4,$5,$6);}' inputfilename 
> outputfilename

Tested with GNU Awk 3.1.1


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:194430
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to