Link to home
Start Free TrialLog in
Avatar of Victor  Charles
Victor CharlesFlag for United States of America

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
ASKER CERTIFIED SOLUTION
Avatar of deepu chandran
deepu chandran
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Fernando Soto
Hi Victor;

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

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
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.
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.
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
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.
OK, will do.

Thanks.

V.