"Inconsistent number of matrix lines compared to the number of labels" runtime exception error when importing large CSV file into Gephi
Question: The full error is "java.lang.RuntimeException: java.lang.Exception:
Inconsistent number of matrix lines compared to the number of labels."

I am trying to pull an adjacency matrix stored in a CSV file into Gephi so
that I can use its modularity optimization tool and make a really slick chart
of my data. I compiled the data in Excel (yes, it took forever) and saved it
as CSV, and then I opened the file in Notepad and used Ctrl + H to replace all
commas with semicolons (and saved it as a CSV file again). My dataset is 5,654
x 5,654 cells, not counting the labels. It is an r-neighborhood graph with r =
.6299 (80th percentile and above).

I searched Google and StackOverflow and I only found one solution for my error
message: to remove all the spaces in the file. I used Ctrl + H again to remove
all spaces, but I received the same error message when I tried to upload the
"spaceless" CSV file. Just to double-check that saving it as CSV didn't cause
an issue, I checked the CSV by opening it up in Excel. The file opened
correctly, but I do not have much experience with CSV files so I do not know
if anything was off. It seemed as though all the records were separated by
semicolons instead of commas and I did not see any spaces.

Is it the size of my file? I am currently struggling through learning some
Python and R, and I would be open to creating this adjacency matrix CSV file
in either of those environments and then feeding it to Gephi. I just need a
dependable solution that works without bogging my computer down in Excel all
afternoon and allows me to be the "slick graph superhero" of my office.


Answer: Not a direct answer to your problem but there is also the [Excel/CSV import
spigot](https://marketplace.gephi.org/plugin/excel-csv-converter-to-network/)
to whatever it might be useful. Otherwise you could perhaps try to import the
network with NodeXL and then save it in GraphML format which can then be
opened by Gephi

