Thursday, April 30, 2009

Converting CSV file to HTML file by using VIM

I wrote a small VIM script to convert CSV file to HTML file.

You can get it from http://www.tnsatish.com/software/csvtohtml.vim

Usage is : vim -s csvtohtml.vim <filename>


After running the above command, the file will contain html code in place of CSV. This script will not work, if there are new lines or commas in any cell.

First row will be taken as header, and the color for that is ff80ff. For all the remaining rows, the color would be changed alternatively (b0ffff and ffff80). You can change the corresponding colors in the script (for bgcolor in tr tag), and the html would be created with the colors given.


Contents of csvtohtml.vim

:%s/^/<tr><td>/g
:%s/\//<br>/g
:%s/$/<\/td><\/tr>/g
:%s/,/<\/td><td>/g
:%s/<td><\/td>/<td>&nbsp;<\/td>/g
:%s/\n/X1X2X3X4X5X6/g
:%s/X1X2X3X4X5X6\(.\{-}\)X1X2X3X4X5X6/X1X2X3X4X5X6\1\r/g
:%s/<tr>/<tr bgcolor="#b0ffff">/
:%s/<tr>/<tr bgcolor="#ffff80">/
:%s/X1X2X3X4X5X6/\r/g
:1 s/bgcolor="[^"]*"/bgcolor="#ff80ff"/
:1 s/^/<table>\r/
:$ s/$/\r<\/table>/
:wq


I have used the above script to create the tables for MLA and MP Contestants at www.tnsatish.com and news.loksatta.org.

Monday, April 27, 2009

Why Advani did not bring black money in Swiss bank when he was in power?


This is the question asked by all the senior congress leaders including Sonia Gandhi and Rahul Gandhi.

Around two years back, Swiss government disclosed the money they had from different countries. They are ready to disclose the account details of the account holders to the government of their respective countries. To get the account details of all the indians, Indian government has to formally ask Swiss government for the details. Few years back, this was not possible, and previous governments could not have done anything in this case.

Instead of asking Swiss government for the details, Congress leaders are criticizing Advani and other leaders for not doing anything when they were in power.

Friday, April 24, 2009

Wipro asks employees to work 2 days a week


Wipro came up with a scheme, Project Enrich for employees who are on bench. It gives an alternative to the employees, by which, they can come to work for 10 days a month, and get pay that is 50 percent of their cost to company (CTC). They will be absorbed back into projects once deployment opportunities come up. The scheme has already enrolled 1000 of their employees.

The company has also introduced Project Rejuvenate, which is though primarily aimed at benched staff, will also be open to some senior employees. The scheme will allow them to take a leave for one to one-and-a-half years, while they will be offered 25 percent of their CTC. Currently, the company has 10-12 percent of overall employees in the bench which will surge as it plans to recruit more 6,000 employees. "They are good resources and we don't want to lose them. We don't want to do anything drastic as well," said Pratik Kumar, Head of Human Resources (HR) at Wipro.

Source: Silicon India

Monday, April 20, 2009

Telangana - Y.S.Rajasekhar Reddy


After a very long time, One politician (Y.S.Rajasekhar Reddy) directly said, we need united Andhra Pradesh, and not two states. Till now, all politicians (Except Loskatta Leaders) said, only by forming separate state for Telangana, it would be developed. They all are talking about the problems of Telangana people and never problems of Coastal and Rayalaseema regions. Now, Y.S.R. has publicly said, he supports united Andhra, and he raised few good points on partitioning of the state.

What happens to the irrigation projects which spans Telangana and the other part of A.P.? After splitting the state, the projects will not continue, due to problems in separation of water between the state. Unless the water is distributed, those projects cannot continue. The distribution may take minimum a decade (after seeing the same between Tamilnadu and Karnataka; A.P. and Karnataka).

K.Chandra Sekhar Rao (KCR) says, he will close all the colleges started by Andhra people in Telangana. According to the constitution, all Indian citizens have equal rights in any part of India (Except Jammu & Kashmir). But, What KCR said is unconstitutional. At that time, no leader other than Dr.JP has criticized that. Only after the elections in Telangana, YSR criticized that.

KCR is asking to implement G.O. 610, for transferring all Non-Telanganaite people to outside Telangana. This is making Telangana similar to Jammu & Kashmir.

I am sure except KCR and BJP, nobody is interested in splitting the state. But, if they want to split, everyone (people of Coastal, Rayalaseema and Telangana regions) should discuss and finalize on how to separate capital, natural resources, government organizations, employees and many other things. Only after discussing and finalizing those, the state should be separated. Otherwise, Andhra and Telangana may become like India and Pakistan or Karnataka and Tamilnadu. I hope all the leaders take care of these things, and make sure that, even if the state is split, still nobody loses anything. I know KCR never bothers about these.