Skip to content

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Hi, how about something like this:
    C#
    using (WebClient client = new WebClient())
    {
        string url = "http://www.nse-india.com/content/nsccl/oi_cli_limit_07-JAN-2013.lst";
        string downloadedFile = "oi_cli_limit_07-JAN-2013.lst";
        string convertedFile = "oi_cli_limit_07-JAN-2013.xls";
     
        client.DownloadFile(url, downloadedFile);
        ExcelFile.Load(downloadedFile, LoadOptions.CsvDefault)
                 .Save(convertedFile, SaveOptions.XlsDefault);
    }
    The code uses a .NET component for excel spreadsheets and as you can see all you need to do is load an input (from a path or from a stream) and save as an output of the required format (again to a path or to a stream).
    0