0

I am trying to read a log file and then write the data into workbook containing multiple worksheets on the basis of set of conditions. I addRow to sheet whenever I encounter a particular node's data. Nothing is written in final workbook. The problem might be of scoping but I am not able to debug it properly.

I tried adding rows to sheets outside lineReader function. It works correctly and data is written in workbook. However, I need to go through the conditions and that is where problem comes.

av92
  • 120
  • 1
  • 10
  • you probably want to put this all in a try catch and see whether there is an error. – Jeremy Kahan May 30 '19 at 11:21
  • I tried using exception handling and found that the no error has been thrown. – av92 May 30 '19 at 12:04
  • I tried copying your items from the log and splitting them. It may be because of the transition between places, but there are not tabs, so MsgArray had just one entry and MsgArray[2] was empty. – Jeremy Kahan May 30 '19 at 12:39
  • But I see what was trouble here. I suggest line = line.replace(/\s+/g, ' '); before splitting on space. – Jeremy Kahan May 30 '19 at 12:45
  • I have added the snapshot of debug output. msgArray2 indexes are correctly printed even without adding line.replace(/\s+/g, ' ');. – av92 May 30 '19 at 12:47
  • I tried giving arbitrary input to sheet1 inside lineReader function. Even that also not work. That basically means addRow is not working on sheets ```sheet1.addRow({ALL_CPU: 1, ALL_LPM: 2, ALL_TX:3, ALL_RX:4});``` – av92 May 30 '19 at 12:53
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/194183/discussion-between-av92-and-jeremy-kahan). – av92 May 30 '19 at 13:16
  • Sorry. I am out of ideas. This looks like it would be in the wheelhouse of user:5461205 (@Dirk Reichel) – Jeremy Kahan May 30 '19 at 17:33
  • The code has some problem thus I wrote python script to do the same. That works. Thaks for the efforts. – av92 May 30 '19 at 20:21

0 Answers0