Closed CesiraBuffarlotti closed 1 month ago
Where did you generate that xlsx file?
it has something to do with the inlineStr nodes in xl/worksheets/sheet1.xml. Please open the file with libreoffice calc or gnumeric and save it again.. and then try opening it with sc-im..
First of all sorry for the late reply, but I don't check that address frequently 1st mail: I made myself a script in python and openpyxl that reads a MySql db and converts them to an xlsx file 2nd mail: Both libreoffice and gnumeric read the file correctly while sc-im issues segmentation fault I made a change to the file on libreoffice, saved, reopened and everything is ok. With gnumeric it gives me an error, frankly I don't care, but then it opens. This time sc-im opens correctly You say it might be an error in “inlineStr nodes in xl/worksheets/sheet1.xml”. I will try to check, but if you have a suggestion I would appreciate it. sc-im is becoming important to mebecause very fast while LO is very slow thanks
Translated with DeepL.com (free version)
If you happen to make a file with just a few cells, it will help me find where the problem is. Of course it should never make sc-im crash but take note that this can be a problem with openpyxl itself for not following the standard
I prepared two files, one with the.xlsx created by openpyxl and the other by editing (adding a cell) with LO. I am doing a compare files to see the difference. Then I will let you know and prepare a simpler file for you
Well, LO and openpyxl talk different languages so I prepared a small file. 2024-09.xlsx
@CesiraBuffarlotti What I see is a lot of empty inlinestrings like this:
if you patch formats/xlsx.c file like this:
you get this file:
i still dont know if you can have empty inlinestrings..
and with the first file you got:
sorry for the colors but Im using sc-im with putty from outside my main working station
On your concern about there being empty inlinestrings, looking at the first image you sent, I see that you highlighted B6:F6 which are empty, but then values are displayed and that is very strange, at least to me. I'll try to insert the patch and let you know. Thank you
I'm sorry but doesn't work for me These are the changes I made to xlsx.c. I divided each && beacuse it was very difficult to follow your image. Too much Children ;) I followed instructions in Ubuntu with XLSX import & export, but I always get seg fault. I checked the Makefile for xlsx support, I have libzip and libxml2. My pkg-config don't show any of them but the compiler don't write 'no', so I suppose it finds them
// inlinestring
} else if ( s != NULL && ! strcmp(s, "inlineStr") ) {
char * st = NULL;
char * strvalue = (char *) child_node->xmlChildrenNode->xmlChildrenNode->xmlChildrenNode->content;
if (child_node->xmlChildrenNode && child_node->xmlChildrenNode->content)
strvalue = (char *) child_node->xmlChildrenNode->content;
else if (child_node->xmlChildrenNode
&& child_node->xmlChildrenNode
&& child_node->xmlChildrenNode->xmlChildrenNode
&& child_node->xmlChildrenNode->xmlChildrenNode->content)
strvalue = (char *) child_node->xmlChildrenNode->xmlChildrenNode->content;
else if (child_node->xmlChildrenNode
&& child_node->xmlChildrenNode
&& child_node->xmlChildrenNode->xmlChildrenNode
&& child_node->xmlChildrenNode->xmlChildrenNode->xmlChildrenNode
&& child_node->xmlChildrenNode->xmlChildrenNode->xmlChildrenNode->content)
strvalue = (char *) child_node->xmlChildrenNode->xmlChildrenNode->xmlChildrenNode->content;
if (strvalue != NULL && strvalue[0] != '\0') {
st = str_replace (strvalue, "\"", "''");
clean_carrier(st); // we handle padding
swprintf(line_interp, FBUFLEN, L"label %s%d=\"%s\"", coltoa(c), r, st);
send_to_interp(line_interp);
free(st);
}
Please share your latest file and I will try to debug it
if this is what you asked for Anyway.. tnx
No. I meant the xlsx file. Cause I couldnt make it crash.
thank you
I am not getting seg fault. try with this file:
xlsx.c.zip
/usr/bin/ld: formats/xlsx.o: in function open_xlsx': /home/sc-im-main/src/formats/xlsx__.c:398: multiple definition of
open_xlsx'; formats/xlsx.o:/home/sc-im-main/src/formats/xlsx.c:391: first defined here
/usr/bin/ld: formats/xlsx.o: in function export_xlsx': /home/sc-im-main/src/formats/xlsx__.c:585: multiple definition of
export_xlsx'; formats/xlsx.o:/home/sc-im-main/src/formats/xlsx.c:578: first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:187: sc-im] Error 1
I see you are using v0.8.2.. You can try updating to dev branch latest commit or just replace the // inlinestring piece of code of your xlsx.c file with the one I uploaded.
IT WORKS!!! Thank you for your patience
I am not very familiar with github and you should please explain something to me. I entered of the dir /dev then when I went to copy the address to clone I noticed it is the same as the main. what should I do to clone /dev ?
there are two different branches: main and dev. the first one is the stable one. you can choose which one to clone. i havent commit this fix to any of those yet though.
Hello, I beg your pardon for using “issues” to ask you something that frankly I don't know where to ask prebecause it only interests me. I would like to know what part of the code I should modify to make the columns, excluding “A” have the size of “Current format is 4 2 0” obtained by using “f<” several times. Let me try to explain. The file 2024-09.xlsx contains column “A” with people's names, 31 columns with codes of max 2 letters. By loading the file in sc-im (thank you very much for the patch) it is impossible to have an assembly picture or something that looks like it. By shrinking via code the columns to the above dimensions I would get a much more compact and easier to read result
Translated with DeepL.com (free version)
:autofit
or just aa
in normal mode doesnt work for you?
no, neither command works. I tried to use vscode to debug it, but can't compile. Executing task: C/C++: gcc build active file
Starting build...
/usr/bin/gcc -fdiagnostics-color=always -g /Projects/sc-im/src/main.c -o /Projects/sc-im/src/main
/usr/bin/ld: /tmp/ccZQofqW.o: warning: relocation against inputline' in read-only section
.text'
/usr/bin/ld: /tmp/ccZQofqW.o: in function main': /Projects/sc-im/src/main.c:186: undefined reference to
create_dictionary'
/usr/bin/ld: /Projects/sc-im/src/main.c:187: undefined reference to store_default_config_values' /usr/bin/ld: /Projects/sc-im/src/main.c:193: undefined reference to
get_conf_int'
and so on
I think I am not understanding the problem. Please open a discussion.
Running sc-im version 0.8.2 When I run :load /tmp/2024-09.xlsx I get a segmentation fault (core dumped) message 2024-09.xlsx