sed question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm trying to use sed to parse the below data into html and was hoping that
someone in this group could point me in the right direction.

What I am trying to do is to change the "-" character to something else ONLY
when it is next to a number [0-9]. What makes this a challenge for me is
that it can also exist next to a letter but never more than once next to a
number.

The line I am using is below and works fine for what I need expect that the
first digit of the number at the end is cut off in the table I am trying to
build.

'102.1'>Columbus-612
'104.1'>Fredericksburg-628
'108.1'>Garden-Grove-736
'101.1'>Mission-Viejo-1514
'104.1'>Fort-Worth-418
'1030.1'>Ft.-Lauderdale-304
'1050.1'>Hamilton-713

sed -e "s/^'/\<tr\>\<td\>/" $stores_down | sed -e "s/'>/\<\/td\>\<td\>/" | *sed
-e "s/-[0-9]/\<\/td\>\<td\>/"* | sed -e "s/$/\<\/td\>\<\/tr\>/" >> $log

Any suggestions?

Thanks in advance!
~Rob
-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list


[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux