Showing posts with label data. Show all posts
Showing posts with label data. Show all posts

Wednesday, September 17, 2014

Excel Macro to apply data filter, autosize cols etc

I've been working with a lot of hadoop output files lately and inspecting the top results with Excel.

Consequently this is a useful Excel macro to prepare the data for browsing - Applies data filter for sorting, bold headings, freeze top row, autosize columns.

Good to map it to Ctrl + Shift + D as well.


Sub ApplyDataFilter()
'
' Excel 2013 ApplyDataFilter Macro
' Applies data filter, bold headings, freeze top row, autosize columns.
'
    Rows("1:1").Select
    Selection.Font.Bold = True
    With ActiveWindow
        .SplitColumn = 0
        .SplitRow = 1
    End With
    ActiveWindow.FreezePanes = True
    Cells.Select
    Selection.AutoFilter
    Range("A2").Select
   
    Cells.Select
    Cells.EntireColumn.AutoFit
End Sub


Monday, July 21, 2014

Background download of wikipedia dump on Linux

A handy way to download a wikipedia dump in the background in such a way that it continues after ending a terminal session:

$ nohup wget -bqc http://dumps.wikimedia.org/enwiki/20140707/enwiki-20140707-pages-articles-multistream.xml.bz2

Latest wiki dump url can be found here:
http://dumps.wikimedia.org/backup-index.html

References:
http://www.cyberciti.biz/tips/nohup-execute-commands-after-you-exit-from-a-shell-prompt.html
http://www.cyberciti.biz/tips/linux-wget-your-ultimate-command-line-downloader.html