+ Reply to Thread
Results 1 to 33 of 33

many nodes (authors) during xml import

  1. #1
    Registered User
    Join Date
    07-06-2013
    Location
    Poland
    MS-Off Ver
    Excel 2013
    Posts
    24

    many nodes (authors) during xml import

    In developer tab I choose my xml source and generate an xml map. Then I place fields I need inside a Sheet. Problem is that it only displays the first node (author of the publications, when it should display 5). I need something like Autor[1], Autor[2]. How to display multi node data?
    Attached Images Attached Images

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: many nodes (authors) during xml import

    Attach a sample xml file not image. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    07-06-2013
    Location
    Poland
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: many nodes (authors) during xml import

    okay, so before sheet shows how data from one entry is divided into rows, but i'd like to have one row like in csv.
    xml can be downloaded from here: http://dentopolis.org/pubmed.xml
    Attached Files Attached Files

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: many nodes (authors) during xml import

    is that what you want?
    Done with PowerQuery

    btw. your profile says you've Excel 2003 but file is from higher version so update profile about your real excel version
    Attached Files Attached Files

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: many nodes (authors) during xml import

    This is god awful XML file. It won't be easy to get clean data from this.
    As it doesn't have schema and file itself has issues.

    When I checked, there's 1 more LastName than ForeName in the file.
    Bunch of missing nodes etc.

    Sample code:
    Please Login or Register  to view this content.
    It returned:
    There are 1441 LastName nodes and 1440 ForeName nodes
    I wish they'd rid of XML :p
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  6. #6
    Registered User
    Join Date
    07-06-2013
    Location
    Poland
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: many nodes (authors) during xml import

    I've managed to use get columns i neewith Power Query, but as in s666-PQ-xml import.xlsm‎ there are many rows for the same article. how to export it to have tags in one cell divided by "," and authors in one cell divided by ","? (I need to export it to csv)

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: many nodes (authors) during xml import

    Group by what you want in PQ editor then load to the sheet then export to csv with comma delimiter

  8. #8
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: many nodes (authors) during xml import

    here is a whole list (4336 records) if you want (file #2) and grouped with authors and keywords comma separated into single cells (file #3).

    file#2 M code
    Please Login or Register  to view this content.
    file#3 M code
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sandy666; 05-17-2018 at 07:15 PM. Reason: files updated

  9. #9
    Registered User
    Join Date
    07-06-2013
    Location
    Poland
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: many nodes (authors) during xml import

    I've tried to follow your steps in advanced query editor but stucked with merging. could you please help me
    1)create new column called Background (with text in rows), Methods, Results, Conclusions
    2)merge keywords and authors if they are already extracted
    Attached Files Attached Files

  10. #10
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: many nodes (authors) during xml import

    1. Could you update profile about real excel version?
    2. I'll check xlsx post#9 later

  11. #11
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: many nodes (authors) during xml import

    First of all I got this:

    pq-sourceerror.jpg

    I tried change source to xml you gave before but it doesn't work (probably structure is not identical) so attach this "new" xml and list which nodes you want to get from
    in your example a few columns has the same value from the top to the end, do you really need it ?

  12. #12
    Registered User
    Join Date
    07-06-2013
    Location
    Poland
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: many nodes (authors) during xml import

    here's the file http://dentopolis.org/pubmed_result.xml

    what i need is csv formatted like this:
    Article Title - BackgroundText - MethodsText - ResultText - ConclusionsText - Author1, Author2,Author 3 ,etc - JournalTitle - Date - Keywords - PMID
    Last edited by Ninanoki; 05-18-2018 at 02:57 PM.

  13. #13
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: many nodes (authors) during xml import

    Ok, try now
    In case you'll get source error put pubmed_result.xml directly to C:\ or update source path to your xml file

    edit:
    I forgot add code because of staff requirement (IMHO not necessary in this case, but... staff is staff )
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sandy666; 05-18-2018 at 04:57 PM. Reason: see edit

  14. #14
    Registered User
    Join Date
    07-06-2013
    Location
    Poland
    MS-Off Ver
    Excel 2013
    Posts
    24

    Lightbulb Re: many nodes (authors) during xml import

    okay, so I've managed to add custom columns if label is "Background", "Methods", "Results" and "Conclusions" with according text in cells.

    Right now I don't know how to have one row for a single publication so all the authors should be in one cell called authors divided by "," and the same goes for keywords "keyword 1, keyword 2"
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Ninanoki; 05-23-2018 at 10:54 AM.

  15. #15
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: many nodes (authors) during xml import

    here is the way how to add files to the post. if any extension is not supported, zip it then attach


    To attach an Excel file to your post,
    • desensitize data
    • remeber that your example should reflect structure and type of data and contain the result what you want to achieve (manually created if necessary)
    • click Go Advanced,
    • scroll down until you see Manage Attachments,
    • click that and select Browse,
    • select your file and click Open,
    • click Upload and you will see your attachment below Upload Files from a website
    • click Close this window,
    • click Submit reply

    After that you should see attachment in your post

  16. #16
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: many nodes (authors) during xml import

    sorry but I cannot load your xml

    error.jpg

    btw. don't change any post above. if you attach any file as new or update post it as new post because I am not tracking changes but new post only

    However, you can try to Group all columns except authors and keyword - with count - all rows..... and see how it works
    Last edited by sandy666; 05-23-2018 at 03:28 PM.

  17. #17
    Registered User
    Join Date
    07-06-2013
    Location
    Poland
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: many nodes (authors) during xml import

    that's strange that you can't open this file. it's simply an export from https://www.ncbi.nlm.nih.gov/pubmed/?term=dentistry
    i limit number of publications on the left panel and on "Sent to" I select File->XML

  18. #18
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: many nodes (authors) during xml import

    1. how many rows you see loaded in PQ editor?
    2. I don;t know your criteria so I can't limit
    3. I see there "download csv" and you said you want csv, so ...?
    4. did you try group like I said in post above?
    5. could you use english version of Excel ?

  19. #19
    Registered User
    Join Date
    07-06-2013
    Location
    Poland
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: many nodes (authors) during xml import

    1.2571 rows

    2.later i will use large xml export for a whole 2017 year, right now you can export any data range just to have an xml structure.

    3.their csv doesn't contain all the fields like Methods, Results etc.

    4.when i try to group (different settings) I'm getting the same error:
    Expression.Error: Can't convert "Modern treatment of ..." to type Table.
    Details:
    Value=Modern treatment of patients with oncohematological diseases has allowed to achieve remission or even convalescence in many cases. One of ambitious aims put forward by the hematological society is 100% survival and preservation of quality of life in patients with chronic myeloid leukemia (CML). This hope is related with the emergence of targeted therapy for CML. The second-generation tyrosine kinase inhibitor, dasatinib, which is used for treatment of CML, can occasionally induce severe pulmonary hypertension (PH). We presented here a case report of such cardiotoxicity, which was evident as PH and heart failure in a young female patient with CML treated with dasatinib. Information from published reports about this type of cardiotoxicity is provided. At present time, dasatinib is beginning to be extensively used also in other oncological diseases. For this reason, cardiologists and physicians should be aware of this cardiotoxicity, which can cause heart failure in dasatinib-treated patients.
    Type=Type

    5.i will download english version and try again tomorrow.

  20. #20
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: many nodes (authors) during xml import

    So you can see this is xml error probably on the same row. If you scroll down to ca. 7763 row you will see errors
    IMHO their xml is not well formed
    I just downloading xml without any criteria.... right now 153 MB and not finished yet

    edit:
    whole 2017 = 309 MB
    Last edited by sandy666; 05-23-2018 at 05:14 PM.

  21. #21
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: many nodes (authors) during xml import

    Here is whole 2017 xml and xlsm with concatenated authors and keywords
    so you can add any steps between if you want more columns or create labels as you did
    no errors link (ca. 28 MB, rar because zip was over 40 MB)
    ca. 24.589 rows loaded to the sheet
    Please Login or Register  to view this content.
    Let me know asap if you download this file

    edit:
    I forgot to say: path is C:\ninanoki
    Last edited by sandy666; 05-23-2018 at 07:17 PM.

  22. #22
    Registered User
    Join Date
    07-06-2013
    Location
    Poland
    MS-Off Ver
    Excel 2013
    Posts
    24

    Question Re: many nodes (authors) during xml import

    I've installed English version of Excel and I've got columns:
    PMID, Date, JournalTitle, ArticleTitle, Abstract, Authors.

    1)I've lost track of keywords table somewhere
    2)I'd like to have columns:Background,Methods,Results,Conclusions

    I've tried to upload this attachement but there was some error so please get it from here:
    www.dentopolis.org/sandy.xlsx
    Last edited by Ninanoki; 05-24-2018 at 01:39 PM.

  23. #23
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: many nodes (authors) during xml import

    I see you forgot about xml again

    no source - no data - no answer

    and maybe try to use the same source, not changing everytime

  24. #24
    Registered User
    Join Date
    07-06-2013
    Location
    Poland
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: many nodes (authors) during xml import

    xml source http://www.dentopolis.org/2018.zip

    I'm using smaller file because working on final file that is loading for a few minutes is killing me
    later on i will use this action on large final file.

    and i was going step by step through your example with authors and keywords but there was no abstract with results, methods, etc and I couldn't find a way to add it.

  25. #25
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: many nodes (authors) during xml import

    You can add step between others. click on step where you can see node which contain abstract and select from there what you want

  26. #26
    Registered User
    Join Date
    07-06-2013
    Location
    Poland
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: many nodes (authors) during xml import

    I try and try and still I can extract AbstractText not Background, Methods, Results, Conclusions.

  27. #27
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: many nodes (authors) during xml import

    Ok, let me know what you really want. Use any graphic tool to mark node(s) and Order of nodes (columns) in PowerQuery Editor
    Nothing more, don't change any names

    nodes.jpg

    I know you know but I don't know what you know
    Last edited by sandy666; 05-24-2018 at 03:38 PM.

  28. #28
    Registered User
    Join Date
    07-06-2013
    Location
    Poland
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: many nodes (authors) during xml import

    some PubmedArticle nodes contain keywords, some don't. sometimes there is only AbstractText, but usually it contains four Labels (Background, Methods, Results, Conclusions).

    structure of file I need:
    ArticleTitle | AbstractBackground | AbstractMethods | AbstractResults | AbstractConclusions | Date | ArticleTitle | Authors (divides by ,) | Keywords (divided by ,) | PMID
    Attached Images Attached Images

  29. #29
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: many nodes (authors) during xml import

    To be sure:
    Abstract/Label AND Abstract/text ?

    edit:
    and just for this part of 2018 or for whole 2018? (whole 2018 will be much bigger of course )
    Last edited by sandy666; 05-24-2018 at 04:06 PM.

  30. #30
    Registered User
    Join Date
    07-06-2013
    Location
    Poland
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: many nodes (authors) during xml import

    just sample of 2018.

    custom column Background should contain AbstractText with Label "Background" etc

  31. #31
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: many nodes (authors) during xml import

    ok, thanks for answer.

    tomorrow

  32. #32
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: many nodes (authors) during xml import

    Here is
    what you will do with Abstract text and Label it's up to you.

    XML is full of holes so hard to extract appropriate nodes which are, IMHO, not paired well

    sorry but EF again said NO so you can download rar from here: file to download and let me know if you do this

  33. #33
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: many nodes (authors) during xml import

    If that takes care of your original question, & to say Thanks and for better Motivation, please
    1. click on Add Reputtion (bottom left corner of the post of the person(s) who helped you)
      then
    2. select Thread Tools from the menu (top right corner of your thread) and mark this thread as SOLVED.
    If you did it already - ignore it.
    Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Finding Values in Nodes and Child Nodes in XML SOAP POST
    By Julesdude in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2018, 11:33 AM
  2. VBA to help finding out Content Authors/ Last modified subfolder
    By Peep_Show_Fan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-20-2016, 06:39 AM
  3. Making a list of excel file authors
    By jeffmiester in forum Excel General
    Replies: 1
    Last Post: 09-18-2013, 09:41 AM
  4. how 5 authors of the book work in same msword document
    By gsrikanth in forum Word Formatting & General
    Replies: 1
    Last Post: 11-07-2012, 05:14 PM
  5. I can't sepatate semacolon delimited authors
    By dschmitt in forum Excel General
    Replies: 2
    Last Post: 03-11-2010, 04:48 AM
  6. secret code to reveal authors
    By mutldav in forum Excel General
    Replies: 0
    Last Post: 03-03-2005, 12:31 PM
  7. Getting Authors name
    By jdoc_18 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-02-2005, 11:26 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1