Replacing in vi

January 28, 2011 at 22:56:33
Specs: Macintosh
I am have a sample in which an individual blinks during a button press producing a "." instead of their pupil size. Here is some of my data:


c 147 1 0 29 1235.00
c 147 1 0 30 1236.00
c 147 1 0 31 1234.00
c 147 1 0 32 1233.00
c 147 1 0 33 1232.00
c 147 1 0 34 1232.00
c 147 1 0 35 1232.00
c 147 1 0 36 1232.00
c 147 1 0 37 1232.00
c 147 1 0 38 1232.00
c 147 1 0 39 1232.00
c 147 1 0 40 1234.00
c 147 1 0 41 1236.00
c 147 1 0 42 1239.00

I have been trying to use this command: %s/.\0.0 to do it, but to no avail. If anyone could help me it would be greatly appreciated.


See More: Replacing in vi

Report •

#1
January 30, 2011 at 16:27:14
Your question isn't very clear. I don't know what you are trying to replace. Could you explain further?

Report •

#2
January 30, 2011 at 16:37:19
The last row contains pupil sizes(i.e., 1234.00); however, when an individual blinks it produces a "." instead of a pupil size. I want to remove the "." and replace it with 0.0. I tried :1, $s/\.\0.0/g but all it does is replace the "." within the pupil size (i.e., 1234.00) and adds a zero.

I appreaciate your response!


Report •

#3
January 30, 2011 at 19:49:06
OK, I am interpreting that you want - on the last line - to replace the period with:

0.0.

I suggest you press the colon key, : and type:

$s/\./0.0.



Report •
Related Solutions


Ask Question