Skip to content

Instantly share code, notes, and snippets.

@jakesays-old
Last active December 5, 2017 23:10
Show Gist options
  • Save jakesays-old/a6964a88c5b1588ff0e5eb7c7f54f826 to your computer and use it in GitHub Desktop.
Save jakesays-old/a6964a88c5b1588ff0e5eb7c7f54f826 to your computer and use it in GitHub Desktop.
products.AddRange(from row in sheet.GetRowEnumerator()
.AsEnumerable<HSSFRow>()
.SkipUntil(r => r.Cells[0].StringCellValue == "Clearing")
let clearingSymbol = row.Cells[clearingCell].StringCellValue
let globexSymbol = row.Cells[globexCell].StringCellValue
let floorSymbol = row.Cells[floorCell].StringCellValue
let clearportSymbol = row.Cells[clearportCell].StringCellValue
let productName = row.Cells[productNameCell].StringCellValue
let specUrl = row.Cells[productNameCell].Hyperlink?.Address
let @group = row.Cells[groupCell].StringCellValue
let subGroup = row.Cells[subGroupCell].StringCellValue
let category = row.Cells[categoryCell].StringCellValue
let subCategory = row.Cells[subCategoryCell].StringCellValue
let clearedAs = row.Cells[clearedAsCell].StringCellValue
let exchange = row.Cells[exchangeCell].StringCellValue
let volume = (decimal) row.Cells[volumeCell].NumericCellValue
let openInterest = (decimal) row.Cells[openInterestCell].NumericCellValue
select new CmeProduct(clearingSymbol, globexSymbol, floorSymbol, clearportSymbol,
productName, specUrl, @group, subGroup, category, subCategory, clearedAs,
GetSymbolType(@group), GetMarketType(exchange), volume, openInterest));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment