0

I'm working on creating a web page that will allow me to paste in a bunch of text in a textarea and show me a cleaned output of what I need. For example, I can have 5000+ lines that look like this:

2015-08-11 15:45:44 INFO FileCount:135 - Identifier: 198743247, Reg-Category: 255, DailyCount: 1 , DurationCode: 112

The only information I would need is the DailyCount number and the DurationCode number. I have already written the code to extract this information and store the results in an array that looks like this:

[{
"dailyCount" : 1,
"durationCode" : 112
},
{
"dailyCount" : 5,
"durationCode" : 17
},
{
"dailyCount" : 2,
"durationCode" : 6
}]

What I'm trying to achieve is to display this output in a 2 column view so that I can copy the output from the page and paste it in a 2 column Excel sheet. Currently, pasting the output in Excel results in all the data going into 1 column. I tried selecting 2 columns and pasting the data, but Excel complains about the clipboard not having the same size and shape as the selected cells.

Any help is appreciated. I'm using Angular 1.4 to repeat over the array to display the output.

onetwo12
  • 2,140
  • 5
  • 21
  • 32
  • Take a look at: https://stackoverflow.com/questions/14964035/how-to-export-javascript-array-info-to-csv-on-client-side – Gaurav Jul 25 '17 at 14:28
  • @Gaurav - I did come across this during my search, but the problem with this approach is that I don't need to create a csv file. I need to have the output displayed on the screen so that I can copy it and paste it into an already existing Excel file – Parin Gandhi Jul 25 '17 at 14:39

1 Answers1

0

If you are going to copy and paste it into some other file, than does it matter if you copy from webpage or downloaded file.

Surely you display excel file on webpage but you will need additional libraries support or you could display the information in html table and copy it from there.

Gaurav
  • 83
  • 8