-1

How can I delete a period preceded by only one character?

I'm looking for a one line sed or awk code.

The target line is: (the target pattern I want to delete is in **Bold stackoverflow code ***j.*** **)

xxx-xxx, **j.** c., univ los xxx, res grp porous solid \& calorimetry, dept chem, fac sci, bogota, colombia.  

and the result I'm looking for:

xxx-xxx, c., univ los xxx, res grp porous solid \& calorimetry, dept chem, fac sci, bogota, colombia. 
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Another.Chemist
  • 2,386
  • 3
  • 29
  • 43

2 Answers2

0

sed 's/ [a-zA-Z]\./ /g' <filename> will work if you are sure that these characters will not appear at the start of the line and that all such characters will be preceded by spaces.

Hari Menon
  • 33,649
  • 14
  • 85
  • 108
0

Not sure to understand what you want. But this is slightly more robust than the other proposal:

sed 's/\b\w\.//g'

Both however also delete the ".c"...

vlxm
  • 68
  • 6