21 Oct

Using Ant to Concatenate files

The build.xml file to concatenate files using ant. This can be executed using the command ‘ant “ConcatAll”‘


<?xml version="1.0" encoding="UTF-8"?>
<project name = "MyProj" basedir = "." >

	<target name = "ConcatAll" >
		<concat destfile = "final.txt" fixlastline = "yes" >
			<filelist dir = "."
						files = "first_file.txt
								second_file.txt
								third_file.txt"/>
		</concat>
	</target>

</project>
19 Oct

Linux Command to get the Sensex

Another method to get the sensex. This method is more realiable in working – but the data might be a bit old. Data supplied by Yahoo Finances.


curl -s 'http://download.finance.yahoo.com/d/quotes.csv?s=%5EBSESN&f=sl1d1t1c1ohgv&e=.csv'| awk -F ',' '{print $2}'
18 Oct

Sensex Figure using a Linux Command

This one command will fetch and display the latest sensex figure in Linux. This command basically downloads a page, locates a specific line, and then extract just the necessary portion from it. I am sure you could find other uses for this method.


curl -s "http://money.rediff.com/money/jsp/markets_home.jsp" |grep ''|head -n1|perl -pe 's/^.+\">([\d\,\.]+)<\/TD>.+$/\1/i;'