Skip to content

Commit

Permalink
regexp to parse a cell's position corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvit committed Aug 9, 2011
1 parent 9ddcda3 commit 8fe8680
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions examples/nodejs-example.js
Expand Up @@ -36,7 +36,8 @@ var receive = function(dataUrl, dataReady) {
}, 2000);
};

var ft = require('feed-tables');
console.log(process.cwd());
var ft = require(process.cwd() + '/lib/feed-tables.js');

receive("https://spreadsheets.google.com/feeds/cells/0AoooUkEfVrhldEpRekRVakVYWmJ2U2Z4SFBVZ0M1Nnc/od6/public/basic?alt=json",
function(data) {
Expand All @@ -49,4 +50,5 @@ receive("https://spreadsheets.google.com/feeds/cells/0AoooUkEfVrhldEpRekRVakVYWm
} else
console.log("Timeout while fetching the Google Spreadsheet data.");
});



4 changes: 2 additions & 2 deletions lib/feed-tables.js
Expand Up @@ -123,7 +123,7 @@ var CellsFeed = function(data) {

// we need to take care of cellnames like "AA203" etc
var translateCellname = function(posStr) {
var result = posStr.match(/(.+)(\d+)/);
var result = posStr.match(/([A-Z]+)(\d+)/);
var colTxt = result[1];
var r = result[2];
var c = 0;
Expand All @@ -140,7 +140,7 @@ var CellsFeed = function(data) {

var bin_search = function(f, t) {
var p = (t-f)/2>>0;
var position = f + p - 1;
var position = f + p;
var a = ft.data.entry[position].title.$t;
var tr = translateCellname(a);
var c = tr.c;
Expand Down

0 comments on commit 8fe8680

Please sign in to comment.