#2341
|
||||
|
||||
![]() Quote:
One *workaround* woud be to split the exported config into max 1000 rows per file then you can import them one by one. Issue might also happen when the json object changes and new columns show up, see stackoverflow.com/questions/50230358/llimitation-while-converting-big-json-into-csv-in-power-query-editor
__________________
JD-Dev & Server-Admin Last edited by Jiaz; 20.06.2022 at 10:24. |
#2342
|
|||
|
|||
![]() Quote:
Code:
[ "abstractType", "defaultValue", "docs", "enumLabel", "enumOptions", "interfaceName", "key", "storage", "type", "value" ] While it is possible, it will take more than a simple iteration. The 'tsv' file is ultimately intended for use in excel, which is better equipped to handle db structure like this one. When imported correctly, it will contain a table with above 10 keys as column headers, with rows empty or filled with data, depending on whether it is present in the original object. Quote:
In this case it should be equal to 10, not 1000, which is the number of keys listed above. |
#2343
|
||||
|
||||
![]()
@Jiaz
Funny thing is, that I see all 1,178 rows. But I don't know, whether or not everything is complete. Another things that puzzles me is, that every time I e.g. filter a column, and then reset all filters, Excel will only load (once again) only a small part of those 1,178 rows and I have to scroll down several times, until the last row has been reached once again. And all of this is slow: I takes a couple of seconds. And I also cannot adjust the column widths to any size I want. The last column, I can only set to some 30 or 50 % of the width needed. I know, all this is kind of off topic, but maybe you are familiar with handling *.json files with Excel. And you can answer this anyway: As I'm always curious and eager to learn new things (in this case handling *.json files and Excel)... How do I copy/save those rows and columns from the attached screenshot to a 'normal' Excel sheet? Any other opened Excel window is blocked, as long as the attached window is open. What I did, was copy it to another Excel sheet on another PC, connected via Remote Desktop. And also copying it to a txt file and later back to Excel would work. But I guess there must be another way. EDIT Got 'Close & Load' finally working, but the result is not correct. Because now I have 2,618 rows instead of 1,178. Maybe because of that 1,000 rows limitation... Last edited by StefanM; 20.06.2022 at 11:33. |
#2344
|
||||
|
||||
![]() Quote:
Well, for me it's the first time that I got that warning. Never saw it before with other databases. If you read my post addressed to Jiaz, you will see some other 'peculiar' behavior of Excel I experienced here. Anyway, do you think you can find a way to create a tsv file? Or is it that complicated or even impossible, that you have to give up? |
#2345
|
|||
|
|||
![]()
Really? That is what you took from what I wrote?
|
#2346
|
||||
|
||||
![]()
@mgpai:
Please accept my apologies! I guess, this is what you are referring to? Quote:
But I still don't know, whether or not you are prepared to create a tsv generating script. And I have no idea, how much time that would take, and if it would be OK or if it even would be impudent or outrageous to ask for such a script. Once again, I apologize, in case my reaction sounded kind of rude, which for sure wasn't my intention. But if you decide to create that tsv script (with those 10 columns) I can only say once again thanks a lot for your efforts! Last edited by StefanM; 20.06.2022 at 12:29. |
#2347
|
|||
|
|||
![]()
No worries.
Quote:
Code:
/* Export settings Trigger : none */ var rows = []; var file = JD_HOME + "/settings.tsv"; var settings = callAPI("config", "list", ".+", true, true, true, true); var keys = [ "abstractType", "defaultValue", "docs", "enumLabel", "enumOptions", "interfaceName", "key", "storage", "type", "value" ]; rows.push(keys.join("\t")); settings.forEach(function(item) { var row = []; keys.forEach(function(key) { row.push(JSON.stringify(item[key])); }) rows.push(row.join("\t")); }) writeFile(file, rows.join("\n"), false); Let me know if you need any modifications. |
#2348
|
||||
|
||||
![]()
Haven't started testing, yet. But nevertheless already now I have to say:
Thank you so much for your time and efforts. I really appreciate it. Will get back to you with my report later. Will also try to verify the result/columns by comparing the Excel-result (importing the *json file to Excel that is) with the result of the script you just sent me. Once again: Thank you very much. |
#2349
|
||||
|
||||
![]()
Now, here are my test results:
While the *.json export misses some information, the *.tsv export seems to be complete. ![]() Examples (first line is from tsv file, second line is from json file) Code:
["-i","%audio","-vn","-f","ogg","-acodec","libvorbis","-aq","4","%out","-y"] [List] Code:
{"mp4":"mp4"} [Record] If I may ask for a minor modification: Would it be possible to change the name of the output (tsv) file to something like this? 2022-06-20-11-35-10.tsv YYYY-MM-DD-hh-mm-ss.tsv And a far more complex request would be the possibility to restore the settings from the saved tsv file, writing them back to JD that is. But I'm afraid that this would probably really be too much work load. But if I'm wrong and it's not that complicated, I thought I might as well ask... And once more: Thank you very much for what you already did. It's a great and very useful script! ![]() ![]() |
#2350
|
|||
|
|||
![]() Code:
var file = JD_HOME + "/" + new Date().toISOString().substr(0, 19).replace(/[^\d]/g, "-") + ".tsv"; Quote:
You're welcome. |
#2351
|
||||
|
||||
![]() Quote:
__________________
JD-Dev & Server-Admin |
#2352
|
||||
|
||||
![]() Quote:
Example 1: in tsv it reads: ["-i","%audio","-vn","-f","ogg","-acodec","libvorbis","-aq","4","%out","-y"] In json the same reads only:[List] Same applies to example 2 Here instead of: {"mp4":"mp4"} in json it only reads: [Record] Please have a look at the attached screenshot: https://i.imgur.com/9oIEVFh.jpg Black is tsv export and blue is json export. Last edited by StefanM; 21.06.2022 at 10:40. Reason: Added screenshot |
#2353
|
||||
|
||||
![]() Quote:
... thanks a lot for trying, maybe, some time later... ![]() ![]() ![]() ![]() ![]() |
#2354
|
|||
|
|||
![]() Quote:
Today I got this error when running this script Code:
net.sourceforge.htmlunit.corejs.javascript.EcmaError: ReferenceError: "link" is not defined. (#9) Code:
20.06.22 03.34.21 <--> 20.06.22 17.19.40 jdlog://6301035302851/ |
#2355
|
||||
|
||||
![]()
@mpgai:
Sorry to bother you once again. There is one thing I forgot from my initial spec: A column which indicates whether or not the default settings for a row have been changed. (e.g. DEFAULT / CUSTOM) Could you add such a column, please? I'm referring to the yellow arrow in Advanced Settings, indicating that default settings have been changed: ![]() Thanks once again! |
#2356
|
||||
|
||||
![]()
@TomNguyen: You've set wrong Trigger
Quote:
__________________
JD-Dev & Server-Admin |
#2357
|
||||
|
||||
![]()
@mgpai: you could JSON.stringify default and value and compare to check if value is customized or not
__________________
JD-Dev & Server-Admin |
#2358
|
|||
|
|||
![]() Quote:
Update: It works well for the last week. Thanks again! Last edited by TomNguyen; 02.07.2022 at 03:43. |
#2359
|
||||
|
||||
![]()
__________________
JD-Dev & Server-Admin |
#2360
|
||||
|
||||
![]() Quote:
see marcusrauhut.com/importing-json-data-into-excel-power-query/ A single value may contain multiple other values and that's why a single value to column representation doesn't work. In TSV the value is stored as JSON String and that's why value <-> column assignment works fine.
__________________
JD-Dev & Server-Admin |
![]() |
Thread Tools | |
Display Modes | |
|
|