How can i write also to xml file the settings of the Tag property to identify if it's "file" or "directory" ?

The first thing i'm doing is to get from my ftp server all the ftp content information and i tag it so i can identify later if it's a file or a directory:
private int total_dirs;
private int searched_until_now_dirs;
private int max_percentage;
private TreeNode directories_real_time;
private string SummaryText;
private TreeNode CreateDirectoryNode(string path, string name , int recursive_levl )
var directoryNode = new TreeNode(name);
var directoryListing = GetDirectoryListing(path);
var directories = directoryListing.Where(d => d.IsDirectory);
var files = directoryListing.Where(d => !d.IsDirectory);
total_dirs += directories.Count<FTPListDetail>();
searched_until_now_dirs++;
int percentage = 0;
foreach (var dir in directories)
directoryNode.Nodes.Add(CreateDirectoryNode(dir.FullPath, dir.Name, recursive_levl+1));
if (recursive_levl == 1)
TreeNode temp_tn = (TreeNode)directoryNode.Clone();
this.BeginInvoke(new MethodInvoker( delegate
UpdateList(temp_tn);
percentage = (searched_until_now_dirs * 100) / total_dirs;
if (percentage > max_percentage)
SummaryText = String.Format("Searched dirs {0} / Total dirs {1}", searched_until_now_dirs, total_dirs);
max_percentage = percentage;
backgroundWorker1.ReportProgress(percentage, SummaryText);
percentage = (searched_until_now_dirs * 100) / total_dirs;
if (percentage > max_percentage)
SummaryText = String.Format("Searched dirs {0} / Total dirs {1}", searched_until_now_dirs, total_dirs);
max_percentage = percentage;
backgroundWorker1.ReportProgress(percentage, SummaryText);
foreach (var file in files)
TreeNode file_tree_node = new TreeNode(file.Name);
file_tree_node.Tag = "file";
directoryNode.Nodes.Add(file_tree_node);
numberOfFiles.Add(file.FullPath);
return directoryNode;
The line i'm using to Tag is:
file_tree_node.Tag = "file";
So i know what is "file" then i make a simple check if the Tag is not null then i know it's a "file" if it's null then it's directory.
For example this is how i'm checking if it's file or directory after getting all the content from my ftp server:
if (treeViewMS1.SelectedNode.Tag != null)
string s = (string)treeViewMS1.SelectedNode.Tag;
if (s == "file")
file = false;
DeleteFile(treeViewMS1.SelectedNode.FullPath, file);
else
RemoveDirectoriesRecursive(treeViewMS1.SelectedNode, treeViewMS1.SelectedNode.FullPath);
I also update in real time when getting the content of the ftp server xml file on my hard disk with the treeView structure information so when i'm running the program each time it will load the treeView structure with all directories and files.
This is the class of the xml file:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Windows.Forms;
namespace FTP_ProgressBar
class TreeViewXmlPopulation
// Xml tag for node, e.g. 'node' in case of <node></node>
private const string XmlNodeTag = "node";
// Xml attributes for node e.g. <node text="Asia" tag=""
// imageindex="1"></node>
private const string XmlNodeTextAtt = "text";
private const string XmlNodeTagAtt = "tag";
private const string XmlNodeImageIndexAtt = "imageindex";
public static void DeserializeTreeView(TreeView treeView, string fileName)
XmlTextReader reader = null;
try
// disabling re-drawing of treeview till all nodes are added
treeView.BeginUpdate();
reader = new XmlTextReader(fileName);
TreeNode parentNode = null;
while (reader.Read())
if (reader.NodeType == XmlNodeType.Element)
if (reader.Name == XmlNodeTag)
TreeNode newNode = new TreeNode();
bool isEmptyElement = reader.IsEmptyElement;
// loading node attributes
int attributeCount = reader.AttributeCount;
if (attributeCount > 0)
for (int i = 0; i < attributeCount; i++)
reader.MoveToAttribute(i);
SetAttributeValue(newNode,
reader.Name, reader.Value);
// add new node to Parent Node or TreeView
if (parentNode != null)
parentNode.Nodes.Add(newNode);
else
treeView.Nodes.Add(newNode);
// making current node 'ParentNode' if its not empty
if (!isEmptyElement)
parentNode = newNode;
// moving up to in TreeView if end tag is encountered
else if (reader.NodeType == XmlNodeType.EndElement)
if (reader.Name == XmlNodeTag)
parentNode = parentNode.Parent;
else if (reader.NodeType == XmlNodeType.XmlDeclaration)
//Ignore Xml Declaration
else if (reader.NodeType == XmlNodeType.None)
return;
else if (reader.NodeType == XmlNodeType.Text)
parentNode.Nodes.Add(reader.Value);
finally
// enabling redrawing of treeview after all nodes are added
treeView.EndUpdate();
reader.Close();
/// <span class="code-SummaryComment"><summary>
/// Used by Deserialize method for setting properties of
/// TreeNode from xml node attributes
/// <span class="code-SummaryComment"></summary>
private static void SetAttributeValue(TreeNode node,
string propertyName, string value)
if (propertyName == XmlNodeTextAtt)
node.Text = value;
else if (propertyName == XmlNodeImageIndexAtt)
node.ImageIndex = int.Parse(value);
else if (propertyName == XmlNodeTagAtt)
node.Tag = value;
public static void SerializeTreeView(TreeView treeView, string fileName)
XmlTextWriter textWriter = new XmlTextWriter(fileName,
System.Text.Encoding.ASCII);
// writing the xml declaration tag
textWriter.WriteStartDocument();
//textWriter.WriteRaw("\r\n");
// writing the main tag that encloses all node tags
textWriter.WriteStartElement("TreeView");
// save the nodes, recursive method
SaveNodes(treeView.Nodes, textWriter);
textWriter.WriteEndElement();
textWriter.Close();
private static void SaveNodes(TreeNodeCollection nodesCollection,
XmlTextWriter textWriter)
for (int i = 0; i < nodesCollection.Count; i++)
TreeNode node = nodesCollection[i];
textWriter.WriteStartElement(XmlNodeTag);
textWriter.WriteAttributeString(XmlNodeTextAtt,
node.Text);
textWriter.WriteAttributeString(
XmlNodeImageIndexAtt, node.ImageIndex.ToString());
if (node.Tag != null)
textWriter.WriteAttributeString(XmlNodeTagAtt,
node.Tag.ToString());
// add other node properties to serialize here
if (node.Nodes.Count > 0)
SaveNodes(node.Nodes, textWriter);
textWriter.WriteEndElement();
And this is how i'm using the class this method i'm calling it inside the CreateDirectoryNode and i'm updating the treeView in real time when getting the ftp content from the server i build the treeView structure in real time.
DateTime last_update;
private void UpdateList(TreeNode tn_rt)
TimeSpan ts = DateTime.Now - last_update;
if (ts.TotalMilliseconds > 200)
last_update = DateTime.Now;
treeViewMS1.BeginUpdate();
treeViewMS1.Nodes.Clear();
treeViewMS1.Nodes.Add(tn_rt);
TreeViewXmlPopulation.SerializeTreeView(treeViewMS1, @"c:\XmlFile\Original.xml");
ExpandToLevel(treeViewMS1.Nodes, 1);
treeViewMS1.EndUpdate();
And when i'm running the program again in the constructor i'm doing:
if (File.Exists(@"c:\XmlFile\Original.xml"))
TreeViewXmlPopulation.DeserializeTreeView(treeViewMS1, @"c:\XmlFile\Original.xml");
My question is how can i update the xml file in real time like i'm doing now but also with the Tag property so next time i will run the program and will not get the content from the ftp i will know in the treeView what is file and what is directory.
The problem is that now if i will run the program the Tag property is null. I must get the ftp content from the server each time.
But i want that withoutout getting the ftp content from server to Tag each file as file in the treeView structure.
So what i need is somehow where i;m Tagging "file" or maybe when updating the treeView also to add something to the xml file so when i will run the progrma again and read back the xml file it will also Tag the files in the treeView.

Hi
Chocolade1972,
Your case related to Winform Data Controls, So i will move your thread to Windows Forms> Windows
Forms Data Controls and Databinding  forum for better support.
Best regards,
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • How can I write relative path in File, ImageIcon objects

    I have downloaded examples from
    http://java.sun.com/docs/books/tutorial/uiswing/components/example-swing/index.html
    but for some reason images are invisible until I write absolute paths?(I use windows) How can I write relative path in File, ImageIcon objects?

    Hello;
    I've found a lot of complaints about this through the Forte forum as well as on Dejanews. I'm just curious as to whether any of you ended up finding a solution to this problem.
    There was one posting about setting up the subdirectory as a URL rather than a String and then using that as the source of the ImageIcon ... but this didn't work for me.
    Any help whatsoever would be appreciated.
    Thanks!

  • How can i write an image to file

    hi everybody,
    How can i write a java.awt.Image object to a file.I want to write it to file as a jpg image.Is ther any jpegencoder which can write an Image object to file.
    any tips or suggestions
    Thanks in advance

    This may be only of limited use but it shows an encoder in use.
    http://forum.java.sun.com//thread.jsp?forum=5&thread=140954
    http://forum.java.sun.com/thread.jsp?forum=48&thread=446603&tstart=0&trange=15
    rykk

  • File Receiver Adapter:Can't write a large xml file completely

    Hi Folks
    I am doing an IDOC - Xi - FILE scenario where i am writing the xml file as it is onto XI directory.
    The problem i m facing is - the adapter does not write complete file. If i check from AL11 the file i am getting is not exceeding length 660.
    I am not using any content conversion because my requirement is to save xml file as it is.
    This is how it is getting saved:
    <?xml version="1.0" encoding="UTF-8"?>                                                                               
    <ns0:MT_TEST xmlns:ns0="http://test.com/test_sapXi">
    <Account>
    <Account>9899999610</Account>
    <Party>9800000611</Party>
         <Invoice>
              <No>100</No>
              <InvoiceDate>25062010</InvoiceDate>
              <Date>30062010</Date>
              <Total>7</Total>
              <Gross>100</Gross>
              <Net>1000</Net>
                   <Line>
                        <No>100</No>
                        <Date>25062010</Date>
                        <Order>100</Order>
                        <Product>YAG</Product>
                        <Item>100</Item>
                        <Total>7</Total>
                        <Gross>1000</Gross>
    i.e. some tags of <Line> are missing and then closing tags are also missing.          
    Could anyone please help how to extend the length.
    Thanks
    Naina

    So Sorry the structure is like this
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_TEST xmlns:ns0="http://test.com/test_sapXi">
    <Account>
              <Account>9899999610</Account>
              <Party>9800000611</Party>
              <Invoice>
                     <No>100</No>
                     <InvoiceDate>25062010</InvoiceDate>
                     <Date>30062010</Date>
                     <Total>7</Total>
                     <Gross>100</Gross>
                     <Net>1000</Net>
                     <Line>
                            <No>100</No>
                            <Date>25062010</Date>
                            <Order>100</Order>
                            <Product>YAG</Product>
                            <Item>100</Item>
                            <Total>7</Total>
                            <Gross>1000</Gross>
    Shabarish
    I saved the file to .htm from AL11 and saw that this much of the file is getting saved.
    also if i goto communication channel monitoring i could see that in the MESSAGE DISPLAY TOOL it shows
    Write to file "/inbound/xi/107/sss/AB1020100702-132041-124.txt" as text (character encoding US-ASCII) size 660 bytes
    What could be the issue ??
    Naina

  • How can I write more than 32k file in oracle directory

    Hi experts,
    I am struggling while I write more than 32k file size in oracle directory, and throws an error ‘ORA-06502: PL/SQL: numeric or value error, like this.
    This is my procedure
    declare
    l_s_filename   UTL_FILE.file_type;
    begin
       l_s_filename := UTL_FILE.fopen ('INFO_MIGRATION', 'finfinne.txt', 'W');
    FOR rec
          IN ( SELECT SQL_REDO
                  FROM V$LOGMNR_CONTENTS
                 WHERE seg_owner <> 'SYS' AND username = 'GENTEST'
                 AND TABLE_NAME NOT LIKE '%_TEMP'
                       AND OPERATION IN ('UPDATE','INSERT','DELETE')
              ORDER BY TIMESTAMP)
       LOOP
          UTL_FILE.put_line (l_s_filename, rec.SQL_REDO);
       END LOOP;
       UTL_FILE.fclose (l_s_filename);
    end;can any please help me how can I overcome this problem
    Thanks,
    Arun

    You can write by breaking it into small chunks. Also you can try to use DBMS_XSLPROCESSOR.CLOB2FILE. For UTL_FILE the code snippets may looks like
    -- Read chunks of the CLOB and write them to the file
    -- until complete.
       WHILE l_pos < l_blob_len
       LOOP
          DBMS_LOB.READ (rec.l_clob, l_amount, l_pos, l_buffer);
          UTL_FILE.put_line (l_file, l_buffer, FALSE);
          l_pos := l_pos + l_amount;
       END LOOP;

  • How can I query data from XML file stored as a CLOB ?

    Hi folks,
    please see below sample of XML file, which is stored in "os_import_docs", column "document" as CLOB.
    I would like to query this XML file using some SQL select.
    How can I query data form below XML?
    <?xml version="1.0" encoding="UTF-8"?>
    <etd>
      <header>
        <AR>000000000</AR>
        <AW>0</AW>
        <CT>S</CT>
        <CU>H</CU>
        <CZ>SS48</CZ>
        <BU>4</BU>
        <CH>0032</CH>
        <CK>2012-11-01</CK>
        <CL>21:18</CL>
        <CW>225</CW>
        <CX>0</CX>
        <CF>SS-CZL18</CF>
        <DV>2</DV>
      </header>
      <account_group id="234">
        <account id="234">
          <invoice id="000742024">
            <da>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>A</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>88754515</BS>
              <AD>Mike Tyson</AD>
              <AC>Mike Tyson</AC>
              <AZ>CZ6521232465</AZ>
              <AE/>
              <CG>A</CG>
              <AL>A</AL>
              <BZ>.</BZ>
              <AH>Some street</AH>
              <AI/>
              <AF>Some city</AF>
              <AK>Kraj</AK>
              <AG>CZ</AG>
              <AJ>885 21</AJ>
              <CR>21-11-2012</CR>
              <AY>602718709</AY>
              <AV>800184965</AV>
              <AP/>
              <AO/>
              <AQ/>
              <AN/>
            </da>
            <da>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>A</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>88754515</BS>
              <AD>Mike Tyson</AD>
              <AC>Mike Tyson</AC>
              <AZ>CZ6521232465</AZ>
              <AE/>
              <CG>A</CG>
              <AL>L</AL>
              <BZ>Mike Tyson</BZ>
              <AH>Some street</AH>
              <AI/>
              <AF>Some city</AF>
              <AK>Kraj</AK>
              <AG>CZ</AG>
              <AJ>885 21</AJ>
              <CR>21-11-2012</CR>
              <AY/>
              <AV>800184965</AV>
              <AP/>
              <AO/>
              <AQ/>
              <AN/>
            </da>
            <detaildc CH="0032" AB="234" BS="11888954" BB="32" BA="CZ" AT="" CI="7077329000002340342" AU="" DU="1Z48395" CB="CZK">
              <dc>
                <AW>0</AW>
                <CT>D</CT>
                <CU>C</CU>
                <BY>31-10-2012</BY>
                <CA>25-10-2012</CA>
                <CV>8151</CV>
                <BT>12111</BT>
                <CJ>1</CJ>
                <AM>0</AM>
                <DR>PC</DR>
                <DS/>
                <DO>25-10-2012</DO>
                <DQ>18:42</DQ>
                <CE>1</CE>
                <BH>8151</BH>
                <CY>8151 SHELL MALKOVICE P</CY>
                <DP>049336</DP>
                <DT/>
                <BQ/>
                <BR>500000</BR>
                <CN>30</CN>
                <CM>030</CM>
                <BO>160,00</BO>
                <BF>38,900</BF>
                <BC>6224,00</BC>
                <BI>32,417</BI>
                <CD>B</CD>
                <BG>0,600</BG>
                <BK>31,817</BK>
                <BJ>0,000</BJ>
                <DI>8</DI>
                <BP>20,00%</BP>
                <CC>CZK</CC>
                <BM>5090,67</BM>
                <BN>1018,13</BN>
                <BL>6108,80</BL>
                <BD>5090,67</BD>
                <BE>1018,13</BE>
                <DW>6108,80</DW>
                <CO>Nafta</CO>
              </dc>
            </detaildc>
            <dt>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>T</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>11888954</BS>
              <BB/>
              <BA>CZ</BA>
              <DG>1</DG>
              <CN>30</CN>
              <CM>030</CM>
              <DF>160,00</DF>
              <DH>litr</DH>
              <DJ>20,00%</DJ>
              <DD>5090,67</DD>
              <DE>1018,13</DE>
              <DC>6108,80</DC>
              <DB>CZK</DB>
              <DA>P</DA>
              <AX/>
              <CQ/>
              <CP/>
            </dt>
            <dt>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>T</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>11888954</BS>
              <BB/>
              <BA>CZ</BA>
              <DG>2</DG>
              <CN/>
              <CM/>
              <DF>160,00</DF>
              <DH>litr</DH>
              <DJ/>
              <DD>5090,67</DD>
              <DE>1018,13</DE>
              <DC>6108,80</DC>
              <DB>CZK</DB>
              <DA/>
              <AX/>
              <CQ/>
              <CP/>
            </dt>
            <dt>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>T</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>11888954</BS>
              <BB/>
              <BA>CZ</BA>
              <DG>19</DG>
              <CN/>
              <CM/>
              <DF/>
              <DH/>
              <DJ/>
              <DD>5090,67</DD>
              <DE>1018,13</DE>
              <DC>6108,80</DC>
              <DB>CZK</DB>
              <DA/>
              <AX/>
              <CQ/>
              <CP/>
            </dt>
            <dt>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>T</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>11888954</BS>
              <BB/>
              <BA>CZ</BA>
              <DG>8</DG>
              <CN/>
              <CM/>
              <DF/>
              <DH/>
              <DJ/>
              <DD>5090,67</DD>
              <DE>1018,13</DE>
              <DC>6108,80</DC>
              <DB>CZK</DB>
              <DA/>
              <AX/>
              <CQ/>
              <CP/>
            </dt>
          </invoice>
        </account>
      </account_group>
      <footer>
        <AR>999999999</AR>
        <AW>0</AW>
        <CT>S</CT>
        <CU>T</CU>
        <CZ>SS48</CZ>
        <BU>4</BU>
        <CH>0032</CH>
        <CK>2012-11-01</CK>
        <CL>23:04</CL>
        <CW>225</CW>
        <BX>1</BX>
        <CS>7</CS>
        <BW>0000000000000610880</BW>
      </footer>
    </etd>sample - not working:
        select  x.*
        from os_import_docs d
             ,XMLTABLE('/etd/header'
                        PASSING httpuritype(d.document).getXML()
                        COLUMNS
                           response_status varchar2(50) PATH 'AR'
                        )  x
       where d.object_id = 2587058
         and rownum = 1; 
    ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 6196, maximum: 4000)Many thanks,
    Tomas

    Hello,
    many thanks for the reply. Your examples are very usefull for me.
    To answer your questions.
    An XML structure:
    /etd
        /header - repeat in each row in output
        /account_group/account
            /invoice
                /da - repeat for each details under "selected "invoice
                /detaildc/dc - the lowest level 
                /detaildn/dn - the lowest level 
                /dt - repeat for each details under "selected "invoice
        /footer - repeat in each row in outputI would like to to have a 1 row for each "record" in /detaildc section and include related nodes at higher levels.
    Please see below XML file, which is simplified file of example in first post, but includes a complete xml structure which needs to be queried in db.
    <?xml version="1.0" encoding="UTF-8"?>
    <etd>
      <header>
        <AR>000000000</AR>
        <CK>2012-10-31</CK>
        <CF>SS-CZL19</CF>
      </header>
      <account_group id="234">
        <account id="234">
          <invoice id="EI08P4000">
            <da>
              <AR>EI08P4000</AR>
              <AD>Mickey Mouse</AD>
            </da>
            <detaildc DU="1Z56655" CB="EUR">
              <dc>
                <DO>16-10-2012</DO>
                <CY>ASFINAG POST_MAUT</CY>
                <BM>1940,60</BM>
                <CO>Dalnicni znamka</CO>
              </dc>
            </detaildc>
            <detaildc DU="2Z55050" CB="EUR">
              <dc>
                <DO>17-10-2012</DO>
                <CY>ASFINAG POST_MAUT</CY>
                <BM>1328,10</BM>
                <CO>Dalnicni znamka</CO>
              </dc>
            </detaildc>
            <detaildc DU="2Z90001" CB="EUR">
              <dc>
                <DO>27-10-2012</DO>
                <CY>ASFINAG POST_MAUT</CY>
                <BM>185,10</BM>
                <CO>Poplatek</CO>
              </dc>
            </detaildc>
            <dt>
              <AR>EI08P4000</AR>
              <DG>8</DG>
            </dt>
          </invoice>
        </account>
        <account id="234">
          <invoice id="EI13T7777">
            <da>
              <AR>EI13T7777</AR>
              <AD>Mickey Mouse</AD>
            </da>
            <detaildc DU="1Z48302" CB="EUR">
              <dc>
                <DO>26-10-2012</DO>
                <CY>SANEF 07706 A 07704</CY>
                <BM>232,10</BM>
                <CO>Dalnicni poplatek</CO>
              </dc>
            </detaildc> 
            <detaildc DU="1Z48302" CB="EUR">
              <dc>
                <DO>20-10-2012</DO>
                <CY>TEST A 07704</CY>
                <BM>30,10</BM>
                <CO>Poplatek</CO>
              </dc>
            </detaildc>       
            <dt>
              <AR>EI13T7777</AR>
              <DG>8</DG>         
            </dt>
          </invoice>
        </account>
        <account id="234">
          <invoice id="EI327744">
            <da>
              <AR>EI327744</AR>
              <AD>Mickey Mouse</AD>
            </da>
            <detaildn  CI="707732 00000234" >
              <dn>
                <BY>30-10-2012</BY>
                <BM>8,10</BM>
              </dn>
            </detaildn>
            <detaildn CI="707732 00000234" >
              <dn>
                <BY>30-10-2012</BY>
                <BM>399,50</BM>
              </dn>
            </detaildn>
            <dt>
              <AR>EI327744</AR>
            </dt>
          </invoice>
        </account>
        <account id="234">
          <invoice id="EI349515">
            <da>
              <AR>EI349515</AR>
              <AD>Mickey Mouse</AD>
            </da>
            <detaildc DU="1Z56514" CB="EUR">
              <dc>
                <DO>29-10-2012</DO>
                <CY>ALLAMI AUTOPALYAKEZE</CY>
                <BM>1240,60</BM>
                <CO>Dalnicni znamka</CO>
              </dc>
            </detaildc>
            <detaildc DU="1Z56515" CB="EUR">
              <dc>
                <DO>19-10-2012</DO>
                <CY>ASFINAG POST_MAUT</CY>
                <BM>7428,10</BM>
                <CO>Dalnicni znamka</CO>
              </dc>
            </detaildc>
            <detaildc DU="1Z56515" CB="EUR">
              <dc>
                <DO>12-10-2012</DO>
                <CY>UK</CY>
                <BM>954,10</BM>
                <CO>Poplatek</CO>
              </dc>
            </detaildc>
            <dt>
              <AR>EI349515</AR>
              <DG>8</DG>
            </dt>
          </invoice>
        </account>
      </account_group>
      <footer>
        <CZ>SS47</CZ>
        <BU>4</BU>
        <CH>0032</CH>
        <CK>2012-10-31</CK>
        <CL>01:25</CL>
      </footer>
    </etd>Expected output
    AR     CK     CF             AR4             AD             DU     CB     DO             CY                     BM      CO                AR5             DG     CI             BY               BM6     CZ     BU       CH       CK7    CL
    0     41213     SS-CZL19     EI08P4000     Mickey Mouse     1Z56655     EUR     16-10-2012     ASFINAG POST_MAUT     1940,60     Dalnicni znamka        EI08P4000     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI08P4000     Mickey Mouse     2Z55050     EUR     17-10-2012     ASFINAG POST_MAUT     1328,10     Dalnicni znamka        EI08P4000     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI08P4000     Mickey Mouse     2Z90001     EUR     27-10-2012     ASFINAG POST_MAUT      185,10     Poplatek        EI08P4000     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI13T7777     Mickey Mouse     1Z48302     EUR     26-10-2012     SANEF 07706 A 07704      232,10     Dalnicni poplatek  EI13T7777     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI13T7777     Mickey Mouse     1Z48302     EUR     20-10-2012     TEST A 07704               30,10     Poplatek        EI13T7777     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI327744     Mickey Mouse                                                                      EI327744          707732 00000234     30-10-2012     8,10     SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI327744     Mickey Mouse                                                                      EI327744          707732 00000234     30-10-2012     399,50     SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI349515     Mickey Mouse     1Z56514     EUR     29-10-2012     ALLAMI AUTOPALYAKEZE     1240,60     Dalnicni znamka        EI349515     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI349515     Mickey Mouse     1Z56515     EUR     19-10-2012     ASFINAG POST_MAUT     7428,10     Dalnicni znamka        EI349515     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI349515     Mickey Mouse     1Z56515     EUR     12-10-2012     UK                      954,10     Poplatek        EI349515     8                                    SS47     4     32     41213     01:25

  • How can i load Client side XML file to Table

    Hi,
    How can i load the all the XML files (near 10,000 files) available in client machine to the XML table .
    I did try with directrory list in the Webutility demo form, but when the number of file is near to 1,500 its giving error.
    Please suggest the best method to implement my requirements.
    1. XML fies are in a folder in end users machine(Windows OS)
    2. I need to load all the XML files to table (Oracle Database is in Unix)
    I am using forms 10g
    Thanks in advance.
    Rizly

    Hi,
    What is the error you are getting when you reach 1,500 records? Can you post it? You mentioned you are using the webutil to load them. How you are loading? From the client machine you are loading to the database directly? Can you post the code you are using for that?
    -Arun

  • How to update/write to a XML file using JSP?

    If a user enters information in a form, is there any way to write this information into an existing XML document using JSP? Basically, I want my users to be able to add new information into an XML file but I have no idea how to do it.
    Help appreciated.

    Java webservices tutorial should help
    http://java.sun.com/xml/index.jsp

  • How can i extract attributes from XML-file

    Hi!
    I want to extract XML-files.
    And the most tags are no problem,but how can i extract attributes?
    Here is a part from the XML-Schema:
    <xs:complexType name="ATT_LIST">
              <xs:sequence>
                   <xs:element name="ATTRIB" minOccurs="0" maxOccurs="unbounded">
                        <xs:complexType>
                             <xs:sequence>
                                  <xs:element name="VALUE"/>
                             </xs:sequence>
                             <xs:attribute name="ATTNAM" use="required"/>
                        </xs:complexType>
                   </xs:element>
              </xs:sequence>
         </xs:complexType>
    Thanks for help.
    With best regards.
    Nicole

    Hi!
    If i delete one '/' i get the error message:
    data can't be found'
    This is my xml-file:
    <?xml version="1.0" encoding="UTF-8"?>
    <INSOBJ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sv6:8080/sys/schemas/SCOTT/sv6:8080/public/mydocs/inspection_pda_schema.xsd">
         <INSP_PDA>
              <SYSID>900000438</SYSID>
              <INSPECTOR/>
              <INSDAT>20001223</INSDAT>
              <INSOBJ_TYP>MSP-Mast</INSOBJ_TYP>
              <INSOBJ_ID1>BAM / Bad Aussee / Bad Mitterndorf/Grundlsee</INSOBJ_ID1>
              <INSOBJ_ID2>MITTERNDORF 2 - M 259</INSOBJ_ID2>
              <INSOBJ_ID3>239</INSOBJ_ID3>
              <INSOBJ_NAME>259</INSOBJ_NAME>
              <PDA_PORTION>0000000391</PDA_PORTION>
              <GESQUALITAET/>
              <AUSFALLSEINSCH/>
              <ANMERKUNGEN/>
              <LAGE_NORD>48,2281993</LAGE_NORD>
              <LAGE_OST>14,2394658</LAGE_OST>
              <HOEHE/>
              <GPS_STATUS/>
              <KOORD_SYSTEM/>
              <KOORD_EINHEIT/>
              <PLZ/>
              <ORT/>
              <STR_ORTSTEIL/>
              <NUMMER/>
              <BEZEICHNUNG/>
              <GRUNDBESITZER/>
              <TELENR/>
              <ERREICHBARKEIT/>
              <ATT_LIST>
                   <ATTRIB ATTNAM="BAUWEISE">
                        <VALUE>E-Mast</VALUE>
                   </ATTRIB>
                   <ATTRIB ATTNAM="HOLZART">
                        <VALUE>KIEFER</VALUE>
                   </ATTRIB>
              </ATT_LIST>
              <MZ_LIST>
                   <MAS_ZU MZ_NAM="AUSHOLZEN">
                        <VALUE>J</VALUE>
                        <BEMERKUNG/>
                        <INSP_AM/>
                        <INSP_VON/>
                        <DONE_AM>N</DONE_AM>
                        <DONE_VOM/>
                        <URSACHE>2</URSACHE>
                        <DRINGLICH>2</DRINGLICH>
                        <ZIEL_DAT/>
                        <MZ_PARAM_LIST/>
                   </MAS_ZU>
                   <MAS_ZU MZ_NAM="ALLGEMEIN-ANMERKUNG">
                        <VALUE>2 Isolatoren</VALUE>
                        <BEMERKUNG/>
                        <INSP_AM/>
                        <INSP_VON/>
                        <DONE_AM/>
                        <DONE_VOM/>
                        <URSACHE>2</URSACHE>
                        <DRINGLICH/>
                        <ZIEL_DAT/>
                        <MZ_PARAM_LIST/>
                   </MAS_ZU>
                   <MAS_ZU MZ_NAM="Stange erdfaul/hohl">
                        <VALUE>J</VALUE>
                        <BEMERKUNG/>
                        <INSP_AM/>
                        <INSP_VON/>
                        <DONE_AM/>
                        <DONE_VOM/>
                        <URSACHE/>
                        <DRINGLICH/>
                        <ZIEL_DAT/>
                        <MZ_PARAM_LIST/>
                   </MAS_ZU>
                   <MAS_ZU MZ_NAM="Masttyp nicht normgerecht">
                        <VALUE>J</VALUE>
                        <BEMERKUNG/>
                        <INSP_AM/>
                        <INSP_VON/>
                        <DONE_AM/>
                        <DONE_VOM/>
                        <URSACHE/>
                        <DRINGLICH/>
                        <ZIEL_DAT/>
                        <MZ_PARAM_LIST/>
                   </MAS_ZU>
              </MZ_LIST>
         </INSP_PDA>
         <INSP_PDA>
              <SYSID>900000437</SYSID>
              <INSPECTOR/>
              <INSDAT>20001223</INSDAT>
              <INSOBJ_TYP>MSP-Mast</INSOBJ_TYP>
              <INSOBJ_ID1>BAM / Bad Aussee / Bad Mitterndorf/Grundlsee</INSOBJ_ID1>
              <INSOBJ_ID2>MITTERNDORF 2 - M 259</INSOBJ_ID2>
              <INSOBJ_ID3>239</INSOBJ_ID3>
              <INSOBJ_NAME>259</INSOBJ_NAME>
              <PDA_PORTION>0000000391</PDA_PORTION>
              <GESQUALITAET/>
              <AUSFALLSEINSCH/>
              <ANMERKUNGEN/>
              <LAGE_NORD>48,2281993</LAGE_NORD>
              <LAGE_OST>14,2394658</LAGE_OST>
              <HOEHE/>
              <GPS_STATUS/>
              <KOORD_SYSTEM/>
              <KOORD_EINHEIT/>
              <PLZ/>
              <ORT/>
              <STR_ORTSTEIL/>
              <NUMMER/>
              <BEZEICHNUNG/>
              <GRUNDBESITZER/>
              <TELENR/>
              <ERREICHBARKEIT/>
              <ATT_LIST>
                   <ATTRIB ATTNAM="BAUWEISE">
                        <VALUE>E-Mast</VALUE>
                   </ATTRIB>
                   <ATTRIB ATTNAM="HOLZART">
                        <VALUE>KIEFER</VALUE>
                   </ATTRIB>
              </ATT_LIST>
              <MZ_LIST>
                   <MAS_ZU MZ_NAM="AUSHOLZEN">
                        <VALUE>J</VALUE>
                        <BEMERKUNG/>
                        <INSP_AM/>
                        <INSP_VON/>
                        <DONE_AM>N</DONE_AM>
                        <DONE_VOM/>
                        <URSACHE>2</URSACHE>
                        <DRINGLICH>2</DRINGLICH>
                        <ZIEL_DAT/>
                        <MZ_PARAM_LIST/>
                   </MAS_ZU>
                   <MAS_ZU MZ_NAM="ALLGEMEIN-ANMERKUNG">
                        <VALUE>2 Isolatoren</VALUE>
                        <BEMERKUNG/>
                        <INSP_AM/>
                        <INSP_VON/>
                        <DONE_AM/>
                        <DONE_VOM/>
                        <URSACHE>2</URSACHE>
                        <DRINGLICH/>
                        <ZIEL_DAT/>
                        <MZ_PARAM_LIST/>
                   </MAS_ZU>
                   <MAS_ZU MZ_NAM="Stange erdfaul/hohl">
                        <VALUE>J</VALUE>
                        <BEMERKUNG/>
                        <INSP_AM/>
                        <INSP_VON/>
                        <DONE_AM/>
                        <DONE_VOM/>
                        <URSACHE/>
                        <DRINGLICH/>
                        <ZIEL_DAT/>
                        <MZ_PARAM_LIST/>
                   </MAS_ZU>
                   <MAS_ZU MZ_NAM="Masttyp nicht normgerecht">
                        <VALUE>J</VALUE>
                        <BEMERKUNG/>
                        <INSP_AM/>
                        <INSP_VON/>
                        <DONE_AM/>
                        <DONE_VOM/>
                        <URSACHE/>
                        <DRINGLICH/>
                        <ZIEL_DAT/>
                        <MZ_PARAM_LIST/>
                   </MAS_ZU>
              </MZ_LIST>
         </INSP_PDA>
    </INSOBJ>
    Thanks for help.
    With best regards
    Nicole

  • How can I write left and right in the same line of a richtextbox?

    I want to write, in the same line, text with a right aligment and other with left aligment. How can I do it?
    thanks

    I want to write, in the same line, text with a right aligment and other with left aligment. How can I do it?
    thanks
    As
    Viorel_ says "Perhaps there are other much easier solutions. For example, create two
    RichTextBoxes with no borders (if you only need two columns of text)" but the real issue would be saving the info in the RichTextBox's (RTB's) RTF or Text to two different RTF or TextFiles. Although I suppose if it was just going to
    a TextFile then you could somehow use a delimited text file so each same line number of each RTB is appended to the same line and delimited. That way you could probably load a split array with each line from the text file splitting on the delimeter per line
    and providing RTB1 with index 0 of the split array and RTB2 with index 1 of the split array. I'm not going to try that.
    This is some leftover code from a long time ago. It has three RTB's. RTB1 is there I suppose because the thread asking for this code wanted it. RTB2 is borderless as well as RTB3. The Aqua control in the top image below is the Panel used to cover RTB2's
    scrollbar. So RTB3's scrollbar is used to scroll both controls.
    I forgot to test if I typed past the scroll position in RTB2 if both would scroll as maybe RTB3 would not since it would not have anything to scroll to I suppose.
    Maybe this code can help or maybe not. The bottom two images are the app running and displaying nothing scrolled in RTB2 and RTB3 then the scroll used in the bottom image.
    Disregard the commented out code in the code below. It was there so I left it there. I suppose you should delete it. Also I didn't set the RTB's so one was left aligned and the other right aligned. I believe the Panel becomes a control in RTB2's controls
    when it is moved to cover RTB2's vertical scrollbar but don't remember although that seems the case since both RTB2 and RTB3 are brought to front so if the Panel was not one of RTB2's controls I would think it would be behind RTB2 and RTB2's vertical scrollbar
    would display but don't remember now. In fact I don't really remember how that part works. :)
    Option Strict On
    Public Class Form1
    Declare Function SendMessage Lib "user32.dll" Alias "SendMessageW" (ByVal hWnd As IntPtr, ByVal msg As Integer, ByVal wParam As Integer, ByRef lParam As Point) As Integer
    Const WM_USER As Integer = &H400
    Const EM_GETSCROLLPOS As Integer = WM_USER + 221
    Const EM_SETSCROLLPOS As Integer = WM_USER + 222
    Dim FixTheProblem As New List(Of String)
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Me.CenterToScreen()
    Panel1.BackColor = Color.White
    Panel1.BorderStyle = BorderStyle.Fixed3D
    RichTextBox2.BorderStyle = BorderStyle.None
    RichTextBox2.ScrollBars = RichTextBoxScrollBars.Vertical
    RichTextBox3.BorderStyle = BorderStyle.None
    RichTextBox3.ScrollBars = RichTextBoxScrollBars.Vertical
    RichTextBox3.Size = RichTextBox2.Size
    RichTextBox3.Top = RichTextBox2.Top
    RichTextBox3.Left = RichTextBox2.Right - 20
    Panel1.Size = New Size(RichTextBox2.Width * 2 - 16, RichTextBox2.Height + 4)
    Panel1.Left = RichTextBox2.Left - 2
    Panel1.Top = RichTextBox2.Top - 2
    RichTextBox2.BringToFront()
    RichTextBox3.BringToFront()
    FixTheProblem.Add("Curry: £6.50")
    FixTheProblem.Add("Mineral Water: £4.50")
    FixTheProblem.Add("Crisp Packet: £3.60")
    FixTheProblem.Add("Sweat Tea: £2.23")
    FixTheProblem.Add("Motor Oil: £12.50")
    FixTheProblem.Add("Coca Cola: £.75")
    FixTheProblem.Add("Petrol Liter: £3.75")
    FixTheProblem.Add("Shaved Ice: £.50")
    FixTheProblem.Add("Marlboro: £2.20")
    FixTheProblem.Add("Newspaper: £.25")
    FixTheProblem.Add("Spice Pack: £.75")
    FixTheProblem.Add("Salt: £.50")
    FixTheProblem.Add("Pepper: £.30")
    For Each Item In FixTheProblem
    RichTextBox1.AppendText(Item & vbCrLf)
    Next
    RichTextBox1.SelectionStart = 0
    RichTextBox1.ScrollToCaret()
    Dim Fix As String = ""
    For Each Item In FixTheProblem
    Fix += Item.Replace(":", "^:") & vbCrLf
    Next
    Fix = Fix.Replace(vbCrLf, "^>")
    Dim FixSplit() As String = Fix.Split("^"c)
    For i = 0 To FixSplit.Count - 1
    If CBool(i Mod 2 = 0) = True Then
    RichTextBox2.AppendText(FixSplit(i).Replace(">"c, "") & vbCrLf)
    ElseIf CBool(i Mod 2 = 0) = False Then
    RichTextBox3.AppendText(FixSplit(i) & vbCrLf)
    End If
    Next
    End Sub
    Dim RTB2ScrollPoint As Point
    Private Sub RichTextBox2_Vscroll(sender As Object, e As EventArgs) Handles RichTextBox2.VScroll
    Dim RTB2ScrollPoint As Point
    SendMessage(RichTextBox2.Handle, EM_GETSCROLLPOS, 0, RTB2ScrollPoint)
    SendMessage(RichTextBox3.Handle, EM_SETSCROLLPOS, 0, New Point(RTB2ScrollPoint.X, RTB2ScrollPoint.Y))
    'Me.Text = RTB2ScrollPoint.X.ToString & " .. " & RTB2ScrollPoint.Y.ToString
    End Sub
    Private Sub RichTextBox3_Vscroll(sender As Object, e As EventArgs) Handles RichTextBox3.VScroll
    Dim RTB3ScrollPoint As Point
    SendMessage(RichTextBox3.Handle, EM_GETSCROLLPOS, 0, RTB3ScrollPoint)
    SendMessage(RichTextBox2.Handle, EM_SETSCROLLPOS, 0, New Point(RTB3ScrollPoint.X, RTB3ScrollPoint.Y))
    'SendMessage(RichTextBox2.Handle, EM_SETSCROLLPOS, 0, New Point(0, 10))
    End Sub
    End Class
    La vida loca

  • HOW CAN I   WRITE   TEXT IN A     FILE

    HI,
    I have problems with saving files on my hard disk with an JAVA Applet.
    Do you know how to do it in the best way?
    here is the code i'm trying:
    public String getCount()
          int count=456;
          String rec=null;
          DataOutputStream dos = null;
          try
            URL                url;
            URLConnection      urlConn;      
            url = new URL(getCodeBase().toString() + "counter.txt");
            urlConn = url.openConnection();
            urlConn.setDoOutput(true);
            urlConn.setUseCaches(false);
            urlConn.setRequestProperty ("Content-Type", "application/x-www-form-urlencoded");
            rec=""+count;
            dos = new DataOutputStream(urlConn.getOutputStream());
            dos.writeChars(rec);
            dos.flush();
            dos.close();
           catch (MalformedURLException mue) { return mue.toString(); }
           catch (IOException ioe) { return ioe.toString(); }
          return rec;
        }this code is simply saving the value ot count in the file "counter.txt"
    I think the problem comes at the line: dos = new DataOutputStream(urlConn.getOutputStream());
    It doesn't throws exception, it just stopes there and doesn't show any result.
    WHY?
    If you have some ideas ...thanks.
    the class DataInputStream is working perfectly. I'm reading, but saving does not work.

    You're using getCodeBase() to construct the file name, apparently, so I guess you are wanting to write to a file on the server where the applet was loaded from. And it looks like you're trying to do a POST to the URL that you construct, or something like that. But the URL ends in ".txt" so most likely your server isn't exposing that URL to the outside world.
    You're on the right track, but you need to write to a URL that can accept POST requests and knows what to do with them. You can't just write to a file on the server -- if you could do that in your applet then anybody in the world could do it from a simple program, so consider the security implications of that.

  • How can you write TABs in a file?

    Hello everbody,
    suppose you create a simple textfile "Input.txt" in copying the following two lines:
    ABCD
    123
    The code below works fine in creating (on Windows) an ANSI file "Output.txt". Now
    remove the comment slashes in the while loop, and compile and run the program
    again. The output file this time will be a Unicode file with Devanagari
    characters, as two bytes are interpreted as one char. Can anybody tell me why,
    and how it can be prevented?
    import java.io.*;
    class Anwendung
      public static void main(String[] args)
    //    final byte TAB=9; // no difference.
        final int TAB=9;
        try
        { FileInputStream eingabe = new FileInputStream("Input.TXT");
          FileOutputStream ausgabe = new FileOutputStream("Output.TXT");
          int zeichen;
          while ((zeichen=eingabe.read()) != -1)
          { ausgabe.write(zeichen); // only the low byte is taken from the int.
         ausgabe.write(TAB);
          eingabe.close();
          ausgabe.close();
        catch(Throwable e)
        { System.out.println("Error: "+e);
    }Regards
    Joerg

    Hello Tim,
    thanks for your response. Meanwhile I found out, that in fact things work fine. I "tested" the outputfile in opening it with the Notepad editor. That was not the proper way to do it. Making a file dump, I saw that everything was alright. So if one wants to work on such a file with the editor, one should use the Writer classes.
    Regards
    Joerg

  • Can we write query in xml file to get desired field?

    I have  XML script like  below  can I query this file and get returns like Name only  for instance similar to 'select top 5 name from [HumanResources].[Department] order by DepartmentID'
    Engineering
    Tool Design
    Sales
    Marketing
    Purchasing
    <HumanResources.Department DepartmentID="1" Name="Engineering" GroupName="Research and Development" ModifiedDate="2002-06-01T00:00:00" /><HumanResources.Department DepartmentID="2" Name="Tool Design" GroupName="Research and Development" ModifiedDate="2002-06-01T00:00:00" /><HumanResources.Department DepartmentID="3" Name="Sales" GroupName="Sales and Marketing" ModifiedDate="2002-06-01T00:00:00" /><HumanResources.Department DepartmentID="4" Name="Marketing" GroupName="Sales and Marketing" ModifiedDate="2002-06-01T00:00:00" /><HumanResources.Department DepartmentID="5" Name="Purchasing" GroupName="Inventory Management" ModifiedDate="2002-06-01T00:00:00" />

    DECLARE @xml xml='<HumanResources.Department DepartmentID="1" Name="Engineering" GroupName="Research and Development"
     ModifiedDate="2002-06-01T00:00:00" /><HumanResources.Department DepartmentID="2" Name="Tool Design" 
    GroupName="Research and Development" ModifiedDate="2002-06-01T00:00:00" /><HumanResources.Department 
    DepartmentID="3" Name="Sales" GroupName="Sales and Marketing" ModifiedDate="2002-06-01T00:00:00" />
    <HumanResources.Department DepartmentID="4" Name="Marketing" GroupName="Sales and Marketing" 
    ModifiedDate="2002-06-01T00:00:00" /><HumanResources.Department DepartmentID="5" Name="Purchasing" 
    GroupName="Inventory Management" ModifiedDate="2002-06-01T00:00:00" />'
    SELECT T.Name.value('@Name', 'VARCHAR(50)') AS Name
    FROM @xml.nodes('HumanResources.Department')
     AS T(Name);
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How can I combine 200+ XDP (XML) files into one spreadsheet or database for analysis?

    Hi all,
    I've got 200+ XDP files that were created by entering data into a LiveCycle PDF form 200+ times and then exporting the data as XDP 200+ times.
    Now, I want to view all the data at once (for example, in an Excel Spreadsheet or database) so I can look for trends in the data or come up with a summary (for example, 180 of 200 responses answered Question 1 'Yes'). The form does have some image fields, but I don't need to see or analyse those fields.
    I'm a bit of a newbie. Is there an easy way to do this? Thanks!
    - John

    I had a similar goal to gather data from a folder full of XDPs into a spreadsheet to track user behaviors, capture commonly entered values, and run reports.
    If you are familiar with Python, I highly recommend creating a simple script using Python 2.6 and the elementTree (effbot.org) libraries.
    Since I cut my teeth on this project, I found it helpful to break down the script's tasks into individual parts. The material and examples for getting a folder's contents, writing variables in lists, and using elementtree is as terrific as it is scattered in location and diverse in implementation.
    1. Grab an xdp in your directory ( for book in path: )
    2. Parse the xml by using the elementtree iterator
    3. Assign your element's values to variables during iteration
    if element.name == 'dataNode':
         variable = element.text
    4. At the end print your variables with deliminators between each (I used a pipe "|" because commas were commonly used in our forms)
    print "%s|%s|%s|%s|%s" % (currentFileName, variable1, variable2, variable3, variable4)
    Once you are happy with the data printed out to your console; and each row corresponds to a xdp, stream the output to a file and import that file into Excel in a CSV-style text import (specifying your deliminator during the import process)
    so if your script that does the above is called "xdpGrabber.py", run:
    $ python xdpGrabber.py >> xdpSpreadSheet.txt
    and open xdpSpreadSheet.txt in excel.
    There are some gotchas here - repeating nodes can be tricky, and heavily nested or scattered xml structures will add much more complexity to the script.  However, if you are only looking for certain fields that always come in the same order when reading the xdps from top to bottom you can get them using simple "if element.name == 'stuff'" references in the order they appear - as elementtree parses from top to bottom.
    If this is appealing to you, I suggest you run one of your sample xdps against the example script given here: http://www.xml.com/pub/a/2003/02/12/py-xml.html
    I used Python 2.6 and elementtree on a windows XP laptop.  I would routinely create spreadsheets from 3000+ xdps, each with 50-100KB of data, in under 15 minutes.  I'm guessing the real bottleneck is streaming the output to disk. There isn't much out there that can compete with elementtree for speed reading xml!
    If you need some assistance getting started  feel free to reply here or message me for an example script.
    Good luck!
    -Kasey (scriptocratch)

  • How can I write to a (external)file from a stored procedure

    I want to write some data to a (external) file. I have it working with the function UTL_FILE.
    My problem is I want to write to a file on a mapped drive (so a drive on a different machine). This is not working.
    Does anyone know a way to build this.
    Please send your responses to [email protected]
    Many thanks,
    Alex Nagtegaal

    an extraction out of expert one-on-one from Thomas Kyte
    <quote>
    when an oracle istance is created the services that support it are setup to 'log on as' the system (or operating system) account, this account has very few privileges and no acces to Window NT Domains. To access another Windows NT machine the OracleServiceXXXX must be setup to logon to the appropriate Windows NT Domain as a user who has acces to the required location for UTL_FILE.
    To change the default logon for the Oracle services go to (in Windows NT):
    Control Panel | Services | OracleServiceXXXX | startup | log on as; (where XXXX is the instance name)
    In Windows 2000, this would be:
    Control Panel | Administrative Tools | Services | OracleServiceXXX | Properties | Log on tab; (again XXXX is the instance name)
    Choose the This Account radio button, and then complete the appropriate domain login information. ONce the services have been setup as a user with the appropriate privileges, ther are two options dfor setting UTL_FILE_DIR:
    * Mapped Dirve: To use a mapped drive, the user that the service starts as must have setup a drive to match UTL_FILE_DIR and be logged onto the server when UTL_FILE is in use.
    * Universal Naming Convention: UNC is preferable to Mapped Drives because it does not require anyone to be logged on and utl_file_dir should be set to a name in the form \\<machine name>\<share name>\<path>
    You will of course need to stop and restart Oracle after changing the properties of the service.
    <\quote>
    I want to write some data to a (external) file. I have it working with the function UTL_FILE.
    My problem is I want to write to a file on a mapped drive (so a drive on a different machine). This is not working.
    Does anyone know a way to build this.
    Please send your responses to [email protected]
    Many thanks,
    Alex Nagtegaal

Maybe you are looking for

  • Fire fox is not opening no matter how many times i click on it

    i am using fire fox 30.0 it is not opening not matter how many times i click, it won't show any action i request please solve my problem i have been working on my pc to become perfect and now when it is this is the only problem i am facing now i can'

  • FAQ suggestion

    Hi I've read all the threads in the forum and there are several questions that keep coming up. I know the answers to some of the questions but still looking for answers to the rest. The team might find it useful to see it from the view point of someo

  • DYNAMIC SELECTIONS IN SELECTION SCREEN

    I DONNO ANYTHING ABT DYNAMIC SELECTIONS. CUD U PLZ TELL ME HOW TO GIVE DYNAMIC SELECTIONS FOR ANY FIELD?

  • Program problem

    I can not send email from my phone.  Everything else works fine.  After hitting the send command the phone attempts to send the message for 3-5 sec. and then a red X appears next to the unsent message in the message box.  How do I fix????

  • LDAP PL/SQL API

    Subject: DBMS_LDAP get ORA-06502 and ORA-06512 error msgs I used DBMS_LDAP in PL/SQL procedure and am getting the following error msgs. Could anyone help? ORA-06502: PL/SQL: numeric or value error ORA-06512: at "SYS.OWA_UTIL", line 315 ORA-06512: at