Would this work? echo "BC-2:2009-02-15:Flow:150.00:ft/sec:Temperature (field):7.40:oF:Conductance,Specific:2058.00:umhos/cm:pH:7.40:Std Units" | awk -F: '{ print $1":"$2":"$3":"$4":"$5 ; print $1":"$2":"$6":"$7":"$8 ; print $1":"$2":"$9":"$10":"$11 ; print $1":"$2":"$12":"$13":"$14 ; }'
The same in perl: echo "BC-2:2009-02-15:Flow:150.00:ft/sec:Temperature (field):7.40:oF:Conductance,Specific:2058.00:umhos/cm:pH:7.40:Std Units" | perl -F: -lane ' print join(":",@F[0,1,2,3,4]) ; print join(":",@F[0,1,5,6,7]) ; print join(":",@F[0,1,8,9,10]) ; print join(":",@F[0,1,11,12,13]) ; ' Regards, - Robert On Tue, Mar 22, 2011 at 4:32 PM, Rich Shepard <rshep...@appl-ecosys.com> wrote: > I have a text file whose rows are formatted like this: > > BC-2:2009-02-15:Flow:150.00:ft/sec:Temperature (field):7.40:oF:Conductance, > Specific:2058.00:umhos/cm:pH:7.40:Std Units > BC-2:2009-05-15:Flow::ft/sec:Temperature (field):10.10:oF:Conductance, > Specific:1224.00:umhos/cm:pH:8.14:Std Units > BC-3:2009-02-15:Flow:326.00:ft/sec:Temperature (field):7.80:oF:Conductance, > Specific:576.50:umhos/cm:pH:7.40:Std Units > > and I need to have them split into multiple rows. Each row would have field > #1, a colon separator, field #2, a colon separator, then the parameter name, > measured value, and units. A job for awk! ... _______________________________________________ PLUG mailing list PLUG@lists.pdxlinux.org http://lists.pdxlinux.org/mailman/listinfo/plug