jamefarm
March 12th, 2010, 05:48 PM
Hello, I have a text file that is tab delimited with 6 fields, what I need to do is replace the final field. Here's a sample of the text file:
NAVI Navisite -0.08 -0.08 -0.09 11-Mar
NEN New England Realty null null null 11-Mar AMC
NPSP NPS Pharmaceuticals -0.13 -0.14 -0.18 11-Mar 4:30 PM
I need to replace the date field with a variable, but lets just use 2010-03-11 for now. The beginning of the field will begin with either 1 or 2 numbers followed by a dash etc... e.g. 9-Mar, or 11-Mar AMC
Here's what I tried, though it didn't work.
sed 's/[0-9]+(?=-.)/2010-03-11/g'
NAVI Navisite -0.08 -0.08 -0.09 11-Mar
NEN New England Realty null null null 11-Mar AMC
NPSP NPS Pharmaceuticals -0.13 -0.14 -0.18 11-Mar 4:30 PM
I need to replace the date field with a variable, but lets just use 2010-03-11 for now. The beginning of the field will begin with either 1 or 2 numbers followed by a dash etc... e.g. 9-Mar, or 11-Mar AMC
Here's what I tried, though it didn't work.
sed 's/[0-9]+(?=-.)/2010-03-11/g'