Reputation: 405
Got a small search and replace question. Say you have some text:
(1, 'car', 'http://cara', 'test'),
(2, 'car', 'http://cara', 'test'),
(3, 'car', 'http://cara', 'test'),
I want to replace all the id columns (numbers) with null, such as:
(, 'car', 'http://cara', 'test'),
(, 'car', 'http://cara', 'test'),
(, 'car', 'http://cara', 'test'),
How would one go about it? Anyone know how to do this in bbedit, textwrangler? Any other tools out there?
Thanks!
Upvotes: 0
Views: 71
Reputation: 3474
You could use a regex in vim to handle your search and replace:
%s/(\S\{-},/(,
replaces the first instance of "(foo," with "(," in a given line
Upvotes: 1
Reputation: 203
You can use vim's visual selection: http://vim.wikia.com/wiki/Cut/copy_and_paste_using_visual_selection
Upvotes: 1