1. count the number of occurrences
: % S/178 // ng
Text Test
711[10.235.170.22:8123] 0 10.232.20.178 1648042 1648042 0 2013-07-29 20:01:35711[10.235.170.22:8123] 11 10.232.20.178 6445135 6129386 315749 2013-07-29 20:19:40711[10.235.170.22:8123] 129 10.232.20.178 2220052 2220052 0 2013-07-29 19:33:04711[10.235.170.22:8123] 111 10.232.20.178 4939938 4754688 185250 2013-07-29 20:19:40711[10.235.170.22:8123] 123 10.232.20.178 284227 284227 0 2013-07-29 19:33:00711[10.235.170.22:8123] 112 10.232.20.178 4393638 4262994 130644 2013-07-29 20:19:40711[10.235.170.22:8123] 121 10.232.20.178 413891 413891 0 2013-07-29 19:33:00711[10.235.170.22:8123] 130 10.232.20.178 2803552 2803552 0 2013-07-29 19:33:04711[10.235.170.22:8123] 10 10.232.20.178 6558889 6235520 323369 2013-07-29 20:19:40711[10.235.170.22:8123] 106 10.232.20.178 5080974 4886037 194937 2013-07-29 20:19:40:%s/178//ng
As a result, it appears in 10 rows and 10 times in total. N, indicating only the number of matched reports, without actual replacement.
10 matches on 10 lines
2. Replace matching items
% S indicates replacement.
: % S/178/ggg
The result is
711[10.235.170.22:8123] 0 10.232.20.ggg 1648042 1648042 0 2013-07-29 20:01:35711[10.235.170.22:8123] 11 10.232.20.ggg 6445135 6129386 315749 2013-07-29 20:19:40711[10.235.170.22:8123] 129 10.232.20.ggg 2220052 2220052 0 2013-07-29 19:33:04711[10.235.170.22:8123] 111 10.232.20.ggg 4939938 4754688 185250 2013-07-29 20:19:40711[10.235.170.22:8123] 123 10.232.20.ggg 284227 284227 0 2013-07-29 19:33:00711[10.235.170.22:8123] 112 10.232.20.ggg 4393638 4262994 130644 2013-07-29 20:19:40711[10.235.170.22:8123] 121 10.232.20.ggg 413891 413891 0 2013-07-29 19:33:00711[10.235.170.22:8123] 130 10.232.20.ggg 2803552 2803552 0 2013-07-29 19:33:04711[10.235.170.22:8123] 10 10.232.20.ggg 6558889 6235520 323369 2013-07-29 20:19:40711[10.235.170.22:8123] 106 10.232.20.ggg 5080974 4886037 194937 2013-07-29 20:19:40
10 substitutions on 10 lines