Warning: Undefined array key 1 in /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php on line 505

Warning: Undefined array key 2 in /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php on line 505

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php on line 557

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1930

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1930

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1930

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1930

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1930

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1930

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1930

Warning: Cannot modify header information - headers already sent by (output started at /home/yogindar/www/blog/wp-content/plugins/visitors-online/visitors-online.php:505) in /home/yogindar/www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1930
{"id":1296,"date":"2013-03-19T01:15:52","date_gmt":"2013-03-19T01:15:52","guid":{"rendered":"http:\/\/www.yogindar.com\/news\/?p=1296"},"modified":"2013-03-23T18:48:50","modified_gmt":"2013-03-23T18:48:50","slug":"find-a-pattern-and-then-do-search-and-replace-of-a-word","status":"publish","type":"post","link":"http:\/\/blog.yogindar.org\/?p=1296","title":{"rendered":"Find a pattern and then do search and replace of a word."},"content":{"rendered":"

I was having a file with format as below.
\n1. Different fields with a field seperator.
\n2. Multiple lines.
\n3. There were multiple lines with same strings to be replaced but there are few lines to match a pattern string to execute find and replace.<\/p>\n

Used the following vi editor command.
\n:%g\/^.*pattern*.$\/s\/find\/replace\/g
\nwhere,
\n%g for using regular expression command in vi.
\n^.*pattern*.$ for searching and selecting lines containing the (semi-)word pattern.
\ns\/find\/replace\/g for string find words with value “find” and replace them with string “replace”.<\/p>\n","protected":false},"excerpt":{"rendered":"

I was having a file with format as below. 1. Different fields with a field seperator. 2. Multiple lines. 3. There were multiple lines with same strings to be replaced but there are few lines to match a pattern string to execute find and replace. Used the following vi editor command. :%g\/^.*pattern*.$\/s\/find\/replace\/g where, %g for […]<\/p>\n","protected":false},"author":29,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1317,225,1337,6,1316],"tags":[1470,1319,1320,1318,1464],"class_list":["post-1296","post","type-post","status-publish","format-standard","hentry","category-favourites","category-how-to","category-my-article","category-technical","category-tweet","tag-find","tag-regexp","tag-replace","tag-tips-2","tag-vim"],"_links":{"self":[{"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=\/wp\/v2\/posts\/1296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1296"}],"version-history":[{"count":5,"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=\/wp\/v2\/posts\/1296\/revisions"}],"predecessor-version":[{"id":1355,"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=\/wp\/v2\/posts\/1296\/revisions\/1355"}],"wp:attachment":[{"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1296"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.yogindar.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}