I have an html table which contains 25,000 rows and 8 columns I want to remove 1st, 2nd, 7th and 8th columns from the table, I can use some Design tools such as MS Visual web developer and Dreamweaver but it take too much time to render the table and some time it does not respond, I am looking for some text editor where I can get the same functionality to increase the performance.
Asked
Active
Viewed 677 times
0
-
1You can use vim to record a macro when you remove the mentioned columns for the first row, and then play it back 24,999 times. It would take some time to complete though, but you can let it run. – Maximiliano Padulo Sep 17 '14 at 07:49
-
You could use Microsoft Excel (not sure of any free alternatives) and just remove each column as required. – Nunners Sep 17 '14 at 07:58
-
can you import html tables into excel? – Maximiliano Padulo Sep 17 '14 at 09:16
1 Answers
0
You can write simple code on javascript.
var table = document.getElementById("mytab");
for (var i = 0, row; row = table.rows[i]; i++) {
//iterate through rows
//rows would be accessed using the "row" variable assigned in the for loop
for (var j = 0, col; col = row.cells[j]; j++) {
if(j == 0 || j == 1 || j == 6 || j == 7) {
row.removeChild(col)
}
}
}
here is Fiddle link

Danis
- 1,978
- 3
- 16
- 27
-
That's clever. You only have to copy the modified html table afterwards. Nice – Maximiliano Padulo Sep 17 '14 at 09:19