Avatar of vcharles
vcharles
 asked on

Help with importing data from LinkFileA to LinkFileB

Hi,

If My LinkFileA.xml contains multiple tables and data elements and LinkFileB.xml  contains the same tables with additional data elements but no data. How do I import data from LinkFileA to LinkFileB where the data elements in LinkFileA matches the data elements in LinkFileB?

Thanks,

Victor
Visual Basic.NET.NET Programming

Avatar of undefined
Last Comment
vcharles

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
deepu chandran

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Fernando Soto

Hi Victor;

Can you give an example of what your input would be and the needed output.
vcharles

ASKER
Hi Fernando,

I meant for example if LinkFileOld.xml contains

<Root>
  <Row>
    <Link_ID>1</Link_ID>
    <Column1>2</Column1>
    <Column2>3</Column2>
    <Column3>4</Column3>
    <Column4>6</Column4>
  </Row>
  <Row1>
    <Link_ID>1</Link_ID>
    <Column1>33</Column1>
  </Row1>
<Row2>
    <Link_ID>1</Link_ID>
    <Column1>33RR</Column1>
  </Row2>
</Root>

and LinkFileNew.ml contains



<Root>
  <Row>
    <Link_ID></Link_ID>
    <Column1></Column1>
    <Column2></Column2>
  </Row>
  <Row1>
    <Link_ID></Link_ID>
    <Column1></Column1>
     <Column2></Column2>
  </Row1>
<Row3>
    <Link_ID></Link_ID>
    <Column1></Column1>
  </Row3>
</Root>

How do I enter the contents from to old file to the new file for the same table (Row, Row1)and data elements?

New LinkFileNew:

<Root>
  <Row>
    <Link_ID>1</Link_ID>
    <Column1>2</Column1>
    <Column2>3</Column2>
  </Row>
  <Row1>
    <Link_ID>1</Link_ID>
    <Column1>33</Column1>
   <Column2></Column2>
  </Row1>
<Row3>
    <Link_ID></Link_ID>
    <Column1></Column1>
  </Row3>
</Root>

Thanks,

Victor
Fernando Soto

Hi Victor;

In previous post you identified a unique table by the XML node <rowX> where x is some number and the <Link_ID>.  But in this case you state you have in LinkFileB you may be missing the value for Link_ID so there would not be a way to match them to nodes in LinkFileA and combined the two.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
vcharles

ASKER
Hi,

I'm trying to import the file in LinkFileNew but for each record I add from LinkFileOLd I also need to keep the data elements in LinkFileNew that are not in LinkFileOld, Link_ID will also be included in LinkFileNew.

As show below, I included the data from LinkFileOld and kept the data elements in LibkFileNew.

<Root>
  <Row>
    <Link_ID>1</Link_ID>
    <Column1>2</Column1>
    <Column2>3</Column2>
  </Row>
  <Row1>
    <Link_ID>1</Link_ID>
    <Column1>33</Column1>
   <Column2></Column2>
  </Row1>
<Row3>
    <Link_ID></Link_ID>
    <Column1></Column1>
  </Row3>
</Root>

Thanks,

V.
vcharles

ASKER
Hi,

I'm trying to import existing data from an old xml file to a new xml file which contains additional data elements or data elements that don't exist in the old xml file.

Victor
Fernando Soto

Hi Victor;

This is not making much sense to me. Please make a post that shows the two files which you are trying to combine. Then show a XML that shows what the combined XML file looks like.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
vcharles

ASKER
OK, will do.

Thanks.

V.