Batch-file to extract the value of xml tags of many .xml files











up vote
0
down vote

favorite












I need help on the optimization of a batch-file to get multiple xml tags of over a thousand xml files into a .txt or .csv.



The .xml's are all in the same format. They are clinical studies and look like this:



    <?xml version="1.0" encoding="UTF-8"?>
<clinical_study rank="373">
<!-- This xml conforms to an XML Schema at:
https://clinicaltrials.gov/ct2/html/images/info/public.xsd -->
<required_header>
<download_date>ClinicalTrials.gov processed this data on May 25, 2017</download_date>
<link_text>Link to the current ClinicalTrials.gov record.</link_text>
<url>https://clinicaltrials.gov/show/NCT00146471</url>
</required_header>
<id_info>
<org_study_id>Kep-F10.3.01</org_study_id>
<nct_id>NCT00146471</nct_id>
</id_info>
<brief_title>Efficacy and Safety of Levetiracetam in the Inpatient Treatment of Alcohol Withdrawal Syndrome</brief_title>
<official_title>Efficacy and Safety of Levetiracetam in the Inpatient Treatment of Alcohol Withdrawal Syndrome [Sicherheit Und Wirksamkeit Von Levetiracetam (Keppra) für Die Behandlung Des stationären Alkoholentzugsyndroms]</official_title>
<sponsors>
<lead_sponsor>
<agency>Charite University, Berlin, Germany</agency>
<agency_class>Other</agency_class>
</lead_sponsor>
</sponsors>
<source>Charite University, Berlin, Germany</source>
<oversight_info>
<has_dmc>Yes</has_dmc>
</oversight_info>
<brief_summary>
<textblock>
The purpose of this study is to evaluate the efficacy and safety of levetiracetam for
treating alcohol withdrawal syndrome (AWS) in inpatients (vs. placebo). The primary come-out
parameter is the reduction of the total needed amount of diazepam for add-on treatment of
acute alcohol withdrawal symptoms. The secondary come-out parameter are - safety criteria
(AE) - reduction of alcohol withdrawal score over the days.
</textblock>
</brief_summary>
<overall_status>Completed</overall_status>
<start_date>January 2006</start_date>
<completion_date type="Actual">September 2007</completion_date>
<primary_completion_date type="Actual">July 2007</primary_completion_date>
<phase>Phase 3</phase>
<study_type>Interventional</study_type>
<has_expanded_access>No</has_expanded_access>
<study_design_info>
<allocation>Randomized</allocation>
<intervention_model>Parallel Assignment</intervention_model>
<primary_purpose>Treatment</primary_purpose>
<masking>Double Blind (Participant, Care Provider, Investigator)</masking>
</study_design_info>
<primary_outcome>
<measure>To evaluate the efficacy and safety of levetiracetam for treating alcohol withdrawal syndrome in inpatients. The primary come-out parameter is the reduction of the amount of diazepam for add-on treatment of acute alcohol withdrawal</measure>
<time_frame>during trial</time_frame>
</primary_outcome>
<secondary_outcome>
<measure>Secondary come-out parameters are - safety criteria (AE) - reduction of alcohol withdrawal score over the days</measure>
<time_frame>during trial</time_frame>
</secondary_outcome>
<number_of_arms>2</number_of_arms>
<enrollment type="Actual">120</enrollment>
<condition>Alcohol Withdrawal Syndrome</condition>
<arm_group>
<arm_group_label>2</arm_group_label>
<arm_group_type>Active Comparator</arm_group_type>
</arm_group>
<arm_group>
<arm_group_label>1: Diazepam plus Placebo</arm_group_label>
<arm_group_type>Placebo Comparator</arm_group_type>
</arm_group>
<intervention>
<intervention_type>Drug</intervention_type>
<intervention_name>Levetiracetam</intervention_name>
<description>1500-2000 mg daily add-on or Placebo Diazepam as needed</description>
<arm_group_label>2</arm_group_label>
<other_name>KEPPRA</other_name>
</intervention>
<intervention>
<intervention_type>Drug</intervention_type>
<intervention_name>Placebo</intervention_name>
<description>1500-2000 mg daily add-on or Placebo Diazepam as needed</description>
<arm_group_label>1: Diazepam plus Placebo</arm_group_label>
</intervention>
<eligibility>
<criteria>
<textblock>
Inclusion Criteria:

- Ages eligible for study: 18-65 years.

- Meets criteria for alcohol dependence according to DSM-IV/ICD-10

- Known withdrawal symptoms in the past in case of discontinuation of alcohol
consumption

- Hospital admission for alcohol detoxification

- Able to provide a written informed consent.

- Able to follow verbal and written instructions (incl. a sufficient knowledge of
German language).

- Must be medically acceptable for study treatment. No past or present physical
disorder that is likely to deteriorate during participation. No ECG abnormality which
would likely worsen during participation and no clinical laboratory abnormality that
would also suggest deterioration during treatment.

- Have a negative urine drug screen for benzodiazepines or heroine or methadone

Exclusion Criteria:

- Current diagnosis of any other substance dependence syndrome other than alcohol
dependence (excluding nicotine and caffeine dependence).

- History of idiopathic epilepsy.

- Patient with any current clinically significant psychiatric disorder (acute
suiciality) or developmental disorder (including organic mental disorder), like
psychotic disorders.

- Patients with the following complications of alcoholism (lifetime): acute delirium
tremens, hallucinatory alcoholic state, Korsakoff`s syndrome, Wernicke
encephalopathy, decomposed liver cirrhosis (Child B, C), suspected cirrhosis with the
following clinical symptoms detected at clinical exam: signs of portal hypertension
and signs of hepato-cellular failure, thrombocytopenia.

- Subjects with known sensitivity of previous adverse reaction to levetiracetam

- Contra-indication (hypersensitivity to levetiracetam or pyrrolidone derivatives) or
known non-response to levetiracetam.

- History of severe GI disease which might render absorption of the medication
difficult or produce medical instability of the patient which would include active
peptic ulcer disease, ulcerative colitis, regional colitis, or evidence by history or
physical exam of GI bleeding.

- Patients with any clinically significant acute or chronic progressive neurological,
gastrointestinal, cardiovascular, hepatic, renal, haematological, endocrine,
dermatological or respiratory disease, such as diabetes, severe infection, acute
alcoholic hepatitis, or any other medical condition with significant worsening of the
clinical situation of the patient that might interfere with the evaluation of study
medication.

- Female patients pregnant, breast-feeding or of child bearing age and not protected by
effective contraceptive such as implants, injectables, combined oral contraceptives,
some IUDS, sexual abstinence, sterilization or vasectomized partner.

- Actually continuous use of pharmacological agents that are known to lower the seizure
threshold or augment or decrease the alcohol withdrawal syndrome.

- Subjects with known sensitivity of previous adverse reaction to diazepam or clonidine

- Contra-indication or known non-response to diazepam or clonidine
</textblock>
</criteria>
<gender>All</gender>
<minimum_age>18 Years</minimum_age>
<maximum_age>65 Years</maximum_age>
<healthy_volunteers>No</healthy_volunteers>
</eligibility>
<overall_official>
<last_name>Martin Schaefer, MD</last_name>
<role>Principal Investigator</role>
<affiliation>Charité Campus Mitte, Klinik für Psychiatrie und Psychotherapie</affiliation>
</overall_official>
<location>
<facility>
<name>MLU Halle-Wittenberg</name>
<address>
<city>Halle</city>
<state>Sachen/Anhalt</state>
<zip>06097</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location>
<facility>
<name>Charité - Universitätsmedizin Berlin, Campus Charité Mitte, Klinik für Psychiatrie und Psychotherapie</name>
<address>
<city>Berlin</city>
<zip>10117</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location>
<facility>
<name>Psychiatrische Klinik der Charité im St.-Hedwig Krankenhaus</name>
<address>
<city>Berlin</city>
<zip>10559</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location>
<facility>
<name>Klinik für Psychiatrie und Suchtmedizin, Kliniken Essen Mitte</name>
<address>
<city>Essen</city>
<zip>45136</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location>
<facility>
<name>Zentrum für Seelische Gesundheit</name>
<address>
<city>Rhede</city>
<zip>46414</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location_countries>
<country>Germany</country>
</location_countries>
<reference>
<citation>Krebs M, Leopold K, Richter C, Kienast T, Hinzpeter A, Heinz A, Schaefer M. Levetiracetam for the treatment of alcohol withdrawal syndrome: an open-label pilot trial. J Clin Psychopharmacol. 2006 Jun;26(3):347-9.</citation>
<PMID>16702910</PMID>
</reference>
<verification_date>September 2008</verification_date>
<lastchanged_date>December 29, 2009</lastchanged_date>
<firstreceived_date>September 6, 2005</firstreceived_date>
<responsible_party>
<name_title>Martin Schaefer, MD</name_title>
<organization>Charite University, Berlin, Germany</organization>
</responsible_party>
<keyword>alcohol withdrawal</keyword>
<keyword>detoxification</keyword>
<keyword>Inpatients</keyword>
<keyword>alcohol dependence according to DSM-IV/ICD-10</keyword>
<keyword>withdrawal symptoms</keyword>
<condition_browse>
<!-- CAUTION: The following MeSH terms are assigned with an imperfect algorithm -->
<mesh_term>Syndrome</mesh_term>
<mesh_term>Substance Withdrawal Syndrome</mesh_term>
</condition_browse>
<intervention_browse>
<!-- CAUTION: The following MeSH terms are assigned with an imperfect algorithm -->
<mesh_term>Ethanol</mesh_term>
<mesh_term>Diazepam</mesh_term>
<mesh_term>Etiracetam</mesh_term>
<mesh_term>Piracetam</mesh_term>
</intervention_browse>
<!-- Results have not yet been posted for this study -->
</clinical_study>


So they all use the same tags and i need a few of them like:




  • overall_official

  • lead_sponsor

  • official_title

  • results_reference

  • overall_status


So far i tried with the following code:



    @echo off
setlocal enabledelayedexpansion
for %%a in (*.xml) do (
call :XMLExtract "%%a" "<results_reference>" location
echo.!location!,%%~na
)
exit /b

:XMLExtract file keystart location
@echo off & setlocal
for /f "tokens=3 delims=<>" %%a in ('Findstr /i /c:%2 "%~1"') do (
set "loc=%%a" & goto :endloop
)
:endLoop
ENDLOCAL & IF "%~3" NEQ "" (SET %~3=%loc%) ELSE echo.%loc%
exit /b


I ran the batch in the command line as: bat >> output.txt or output.csv and it worked perfectly for the overall_status, but with all of the other tags there are problems e.g.:




  • overall_offical: It stops after like 10 of them

  • other tags: The file names are listed (as always), but with no information behind it.


I would really appreciate any help on how this can be fixed or another way to efficiently solve this task. I only have a small, basic understanding of programming, but i am sure to be able to work myself into any easy solutions. The best help would be a way to optimize the batch code to fit this. If there is some information missing i am sorry and i will provide it.










share|improve this question






















  • I don't think one can set the %3 as it is the argument.
    – SteveFest
    May 28 '17 at 0:58










  • Let me recommend to use a language that natively supports XML format for manipulating XML data, because pure batch scripting may easily violate the specifications and make the data inaccessible...
    – aschipfl
    May 29 '17 at 7:01

















up vote
0
down vote

favorite












I need help on the optimization of a batch-file to get multiple xml tags of over a thousand xml files into a .txt or .csv.



The .xml's are all in the same format. They are clinical studies and look like this:



    <?xml version="1.0" encoding="UTF-8"?>
<clinical_study rank="373">
<!-- This xml conforms to an XML Schema at:
https://clinicaltrials.gov/ct2/html/images/info/public.xsd -->
<required_header>
<download_date>ClinicalTrials.gov processed this data on May 25, 2017</download_date>
<link_text>Link to the current ClinicalTrials.gov record.</link_text>
<url>https://clinicaltrials.gov/show/NCT00146471</url>
</required_header>
<id_info>
<org_study_id>Kep-F10.3.01</org_study_id>
<nct_id>NCT00146471</nct_id>
</id_info>
<brief_title>Efficacy and Safety of Levetiracetam in the Inpatient Treatment of Alcohol Withdrawal Syndrome</brief_title>
<official_title>Efficacy and Safety of Levetiracetam in the Inpatient Treatment of Alcohol Withdrawal Syndrome [Sicherheit Und Wirksamkeit Von Levetiracetam (Keppra) für Die Behandlung Des stationären Alkoholentzugsyndroms]</official_title>
<sponsors>
<lead_sponsor>
<agency>Charite University, Berlin, Germany</agency>
<agency_class>Other</agency_class>
</lead_sponsor>
</sponsors>
<source>Charite University, Berlin, Germany</source>
<oversight_info>
<has_dmc>Yes</has_dmc>
</oversight_info>
<brief_summary>
<textblock>
The purpose of this study is to evaluate the efficacy and safety of levetiracetam for
treating alcohol withdrawal syndrome (AWS) in inpatients (vs. placebo). The primary come-out
parameter is the reduction of the total needed amount of diazepam for add-on treatment of
acute alcohol withdrawal symptoms. The secondary come-out parameter are - safety criteria
(AE) - reduction of alcohol withdrawal score over the days.
</textblock>
</brief_summary>
<overall_status>Completed</overall_status>
<start_date>January 2006</start_date>
<completion_date type="Actual">September 2007</completion_date>
<primary_completion_date type="Actual">July 2007</primary_completion_date>
<phase>Phase 3</phase>
<study_type>Interventional</study_type>
<has_expanded_access>No</has_expanded_access>
<study_design_info>
<allocation>Randomized</allocation>
<intervention_model>Parallel Assignment</intervention_model>
<primary_purpose>Treatment</primary_purpose>
<masking>Double Blind (Participant, Care Provider, Investigator)</masking>
</study_design_info>
<primary_outcome>
<measure>To evaluate the efficacy and safety of levetiracetam for treating alcohol withdrawal syndrome in inpatients. The primary come-out parameter is the reduction of the amount of diazepam for add-on treatment of acute alcohol withdrawal</measure>
<time_frame>during trial</time_frame>
</primary_outcome>
<secondary_outcome>
<measure>Secondary come-out parameters are - safety criteria (AE) - reduction of alcohol withdrawal score over the days</measure>
<time_frame>during trial</time_frame>
</secondary_outcome>
<number_of_arms>2</number_of_arms>
<enrollment type="Actual">120</enrollment>
<condition>Alcohol Withdrawal Syndrome</condition>
<arm_group>
<arm_group_label>2</arm_group_label>
<arm_group_type>Active Comparator</arm_group_type>
</arm_group>
<arm_group>
<arm_group_label>1: Diazepam plus Placebo</arm_group_label>
<arm_group_type>Placebo Comparator</arm_group_type>
</arm_group>
<intervention>
<intervention_type>Drug</intervention_type>
<intervention_name>Levetiracetam</intervention_name>
<description>1500-2000 mg daily add-on or Placebo Diazepam as needed</description>
<arm_group_label>2</arm_group_label>
<other_name>KEPPRA</other_name>
</intervention>
<intervention>
<intervention_type>Drug</intervention_type>
<intervention_name>Placebo</intervention_name>
<description>1500-2000 mg daily add-on or Placebo Diazepam as needed</description>
<arm_group_label>1: Diazepam plus Placebo</arm_group_label>
</intervention>
<eligibility>
<criteria>
<textblock>
Inclusion Criteria:

- Ages eligible for study: 18-65 years.

- Meets criteria for alcohol dependence according to DSM-IV/ICD-10

- Known withdrawal symptoms in the past in case of discontinuation of alcohol
consumption

- Hospital admission for alcohol detoxification

- Able to provide a written informed consent.

- Able to follow verbal and written instructions (incl. a sufficient knowledge of
German language).

- Must be medically acceptable for study treatment. No past or present physical
disorder that is likely to deteriorate during participation. No ECG abnormality which
would likely worsen during participation and no clinical laboratory abnormality that
would also suggest deterioration during treatment.

- Have a negative urine drug screen for benzodiazepines or heroine or methadone

Exclusion Criteria:

- Current diagnosis of any other substance dependence syndrome other than alcohol
dependence (excluding nicotine and caffeine dependence).

- History of idiopathic epilepsy.

- Patient with any current clinically significant psychiatric disorder (acute
suiciality) or developmental disorder (including organic mental disorder), like
psychotic disorders.

- Patients with the following complications of alcoholism (lifetime): acute delirium
tremens, hallucinatory alcoholic state, Korsakoff`s syndrome, Wernicke
encephalopathy, decomposed liver cirrhosis (Child B, C), suspected cirrhosis with the
following clinical symptoms detected at clinical exam: signs of portal hypertension
and signs of hepato-cellular failure, thrombocytopenia.

- Subjects with known sensitivity of previous adverse reaction to levetiracetam

- Contra-indication (hypersensitivity to levetiracetam or pyrrolidone derivatives) or
known non-response to levetiracetam.

- History of severe GI disease which might render absorption of the medication
difficult or produce medical instability of the patient which would include active
peptic ulcer disease, ulcerative colitis, regional colitis, or evidence by history or
physical exam of GI bleeding.

- Patients with any clinically significant acute or chronic progressive neurological,
gastrointestinal, cardiovascular, hepatic, renal, haematological, endocrine,
dermatological or respiratory disease, such as diabetes, severe infection, acute
alcoholic hepatitis, or any other medical condition with significant worsening of the
clinical situation of the patient that might interfere with the evaluation of study
medication.

- Female patients pregnant, breast-feeding or of child bearing age and not protected by
effective contraceptive such as implants, injectables, combined oral contraceptives,
some IUDS, sexual abstinence, sterilization or vasectomized partner.

- Actually continuous use of pharmacological agents that are known to lower the seizure
threshold or augment or decrease the alcohol withdrawal syndrome.

- Subjects with known sensitivity of previous adverse reaction to diazepam or clonidine

- Contra-indication or known non-response to diazepam or clonidine
</textblock>
</criteria>
<gender>All</gender>
<minimum_age>18 Years</minimum_age>
<maximum_age>65 Years</maximum_age>
<healthy_volunteers>No</healthy_volunteers>
</eligibility>
<overall_official>
<last_name>Martin Schaefer, MD</last_name>
<role>Principal Investigator</role>
<affiliation>Charité Campus Mitte, Klinik für Psychiatrie und Psychotherapie</affiliation>
</overall_official>
<location>
<facility>
<name>MLU Halle-Wittenberg</name>
<address>
<city>Halle</city>
<state>Sachen/Anhalt</state>
<zip>06097</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location>
<facility>
<name>Charité - Universitätsmedizin Berlin, Campus Charité Mitte, Klinik für Psychiatrie und Psychotherapie</name>
<address>
<city>Berlin</city>
<zip>10117</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location>
<facility>
<name>Psychiatrische Klinik der Charité im St.-Hedwig Krankenhaus</name>
<address>
<city>Berlin</city>
<zip>10559</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location>
<facility>
<name>Klinik für Psychiatrie und Suchtmedizin, Kliniken Essen Mitte</name>
<address>
<city>Essen</city>
<zip>45136</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location>
<facility>
<name>Zentrum für Seelische Gesundheit</name>
<address>
<city>Rhede</city>
<zip>46414</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location_countries>
<country>Germany</country>
</location_countries>
<reference>
<citation>Krebs M, Leopold K, Richter C, Kienast T, Hinzpeter A, Heinz A, Schaefer M. Levetiracetam for the treatment of alcohol withdrawal syndrome: an open-label pilot trial. J Clin Psychopharmacol. 2006 Jun;26(3):347-9.</citation>
<PMID>16702910</PMID>
</reference>
<verification_date>September 2008</verification_date>
<lastchanged_date>December 29, 2009</lastchanged_date>
<firstreceived_date>September 6, 2005</firstreceived_date>
<responsible_party>
<name_title>Martin Schaefer, MD</name_title>
<organization>Charite University, Berlin, Germany</organization>
</responsible_party>
<keyword>alcohol withdrawal</keyword>
<keyword>detoxification</keyword>
<keyword>Inpatients</keyword>
<keyword>alcohol dependence according to DSM-IV/ICD-10</keyword>
<keyword>withdrawal symptoms</keyword>
<condition_browse>
<!-- CAUTION: The following MeSH terms are assigned with an imperfect algorithm -->
<mesh_term>Syndrome</mesh_term>
<mesh_term>Substance Withdrawal Syndrome</mesh_term>
</condition_browse>
<intervention_browse>
<!-- CAUTION: The following MeSH terms are assigned with an imperfect algorithm -->
<mesh_term>Ethanol</mesh_term>
<mesh_term>Diazepam</mesh_term>
<mesh_term>Etiracetam</mesh_term>
<mesh_term>Piracetam</mesh_term>
</intervention_browse>
<!-- Results have not yet been posted for this study -->
</clinical_study>


So they all use the same tags and i need a few of them like:




  • overall_official

  • lead_sponsor

  • official_title

  • results_reference

  • overall_status


So far i tried with the following code:



    @echo off
setlocal enabledelayedexpansion
for %%a in (*.xml) do (
call :XMLExtract "%%a" "<results_reference>" location
echo.!location!,%%~na
)
exit /b

:XMLExtract file keystart location
@echo off & setlocal
for /f "tokens=3 delims=<>" %%a in ('Findstr /i /c:%2 "%~1"') do (
set "loc=%%a" & goto :endloop
)
:endLoop
ENDLOCAL & IF "%~3" NEQ "" (SET %~3=%loc%) ELSE echo.%loc%
exit /b


I ran the batch in the command line as: bat >> output.txt or output.csv and it worked perfectly for the overall_status, but with all of the other tags there are problems e.g.:




  • overall_offical: It stops after like 10 of them

  • other tags: The file names are listed (as always), but with no information behind it.


I would really appreciate any help on how this can be fixed or another way to efficiently solve this task. I only have a small, basic understanding of programming, but i am sure to be able to work myself into any easy solutions. The best help would be a way to optimize the batch code to fit this. If there is some information missing i am sorry and i will provide it.










share|improve this question






















  • I don't think one can set the %3 as it is the argument.
    – SteveFest
    May 28 '17 at 0:58










  • Let me recommend to use a language that natively supports XML format for manipulating XML data, because pure batch scripting may easily violate the specifications and make the data inaccessible...
    – aschipfl
    May 29 '17 at 7:01















up vote
0
down vote

favorite









up vote
0
down vote

favorite











I need help on the optimization of a batch-file to get multiple xml tags of over a thousand xml files into a .txt or .csv.



The .xml's are all in the same format. They are clinical studies and look like this:



    <?xml version="1.0" encoding="UTF-8"?>
<clinical_study rank="373">
<!-- This xml conforms to an XML Schema at:
https://clinicaltrials.gov/ct2/html/images/info/public.xsd -->
<required_header>
<download_date>ClinicalTrials.gov processed this data on May 25, 2017</download_date>
<link_text>Link to the current ClinicalTrials.gov record.</link_text>
<url>https://clinicaltrials.gov/show/NCT00146471</url>
</required_header>
<id_info>
<org_study_id>Kep-F10.3.01</org_study_id>
<nct_id>NCT00146471</nct_id>
</id_info>
<brief_title>Efficacy and Safety of Levetiracetam in the Inpatient Treatment of Alcohol Withdrawal Syndrome</brief_title>
<official_title>Efficacy and Safety of Levetiracetam in the Inpatient Treatment of Alcohol Withdrawal Syndrome [Sicherheit Und Wirksamkeit Von Levetiracetam (Keppra) für Die Behandlung Des stationären Alkoholentzugsyndroms]</official_title>
<sponsors>
<lead_sponsor>
<agency>Charite University, Berlin, Germany</agency>
<agency_class>Other</agency_class>
</lead_sponsor>
</sponsors>
<source>Charite University, Berlin, Germany</source>
<oversight_info>
<has_dmc>Yes</has_dmc>
</oversight_info>
<brief_summary>
<textblock>
The purpose of this study is to evaluate the efficacy and safety of levetiracetam for
treating alcohol withdrawal syndrome (AWS) in inpatients (vs. placebo). The primary come-out
parameter is the reduction of the total needed amount of diazepam for add-on treatment of
acute alcohol withdrawal symptoms. The secondary come-out parameter are - safety criteria
(AE) - reduction of alcohol withdrawal score over the days.
</textblock>
</brief_summary>
<overall_status>Completed</overall_status>
<start_date>January 2006</start_date>
<completion_date type="Actual">September 2007</completion_date>
<primary_completion_date type="Actual">July 2007</primary_completion_date>
<phase>Phase 3</phase>
<study_type>Interventional</study_type>
<has_expanded_access>No</has_expanded_access>
<study_design_info>
<allocation>Randomized</allocation>
<intervention_model>Parallel Assignment</intervention_model>
<primary_purpose>Treatment</primary_purpose>
<masking>Double Blind (Participant, Care Provider, Investigator)</masking>
</study_design_info>
<primary_outcome>
<measure>To evaluate the efficacy and safety of levetiracetam for treating alcohol withdrawal syndrome in inpatients. The primary come-out parameter is the reduction of the amount of diazepam for add-on treatment of acute alcohol withdrawal</measure>
<time_frame>during trial</time_frame>
</primary_outcome>
<secondary_outcome>
<measure>Secondary come-out parameters are - safety criteria (AE) - reduction of alcohol withdrawal score over the days</measure>
<time_frame>during trial</time_frame>
</secondary_outcome>
<number_of_arms>2</number_of_arms>
<enrollment type="Actual">120</enrollment>
<condition>Alcohol Withdrawal Syndrome</condition>
<arm_group>
<arm_group_label>2</arm_group_label>
<arm_group_type>Active Comparator</arm_group_type>
</arm_group>
<arm_group>
<arm_group_label>1: Diazepam plus Placebo</arm_group_label>
<arm_group_type>Placebo Comparator</arm_group_type>
</arm_group>
<intervention>
<intervention_type>Drug</intervention_type>
<intervention_name>Levetiracetam</intervention_name>
<description>1500-2000 mg daily add-on or Placebo Diazepam as needed</description>
<arm_group_label>2</arm_group_label>
<other_name>KEPPRA</other_name>
</intervention>
<intervention>
<intervention_type>Drug</intervention_type>
<intervention_name>Placebo</intervention_name>
<description>1500-2000 mg daily add-on or Placebo Diazepam as needed</description>
<arm_group_label>1: Diazepam plus Placebo</arm_group_label>
</intervention>
<eligibility>
<criteria>
<textblock>
Inclusion Criteria:

- Ages eligible for study: 18-65 years.

- Meets criteria for alcohol dependence according to DSM-IV/ICD-10

- Known withdrawal symptoms in the past in case of discontinuation of alcohol
consumption

- Hospital admission for alcohol detoxification

- Able to provide a written informed consent.

- Able to follow verbal and written instructions (incl. a sufficient knowledge of
German language).

- Must be medically acceptable for study treatment. No past or present physical
disorder that is likely to deteriorate during participation. No ECG abnormality which
would likely worsen during participation and no clinical laboratory abnormality that
would also suggest deterioration during treatment.

- Have a negative urine drug screen for benzodiazepines or heroine or methadone

Exclusion Criteria:

- Current diagnosis of any other substance dependence syndrome other than alcohol
dependence (excluding nicotine and caffeine dependence).

- History of idiopathic epilepsy.

- Patient with any current clinically significant psychiatric disorder (acute
suiciality) or developmental disorder (including organic mental disorder), like
psychotic disorders.

- Patients with the following complications of alcoholism (lifetime): acute delirium
tremens, hallucinatory alcoholic state, Korsakoff`s syndrome, Wernicke
encephalopathy, decomposed liver cirrhosis (Child B, C), suspected cirrhosis with the
following clinical symptoms detected at clinical exam: signs of portal hypertension
and signs of hepato-cellular failure, thrombocytopenia.

- Subjects with known sensitivity of previous adverse reaction to levetiracetam

- Contra-indication (hypersensitivity to levetiracetam or pyrrolidone derivatives) or
known non-response to levetiracetam.

- History of severe GI disease which might render absorption of the medication
difficult or produce medical instability of the patient which would include active
peptic ulcer disease, ulcerative colitis, regional colitis, or evidence by history or
physical exam of GI bleeding.

- Patients with any clinically significant acute or chronic progressive neurological,
gastrointestinal, cardiovascular, hepatic, renal, haematological, endocrine,
dermatological or respiratory disease, such as diabetes, severe infection, acute
alcoholic hepatitis, or any other medical condition with significant worsening of the
clinical situation of the patient that might interfere with the evaluation of study
medication.

- Female patients pregnant, breast-feeding or of child bearing age and not protected by
effective contraceptive such as implants, injectables, combined oral contraceptives,
some IUDS, sexual abstinence, sterilization or vasectomized partner.

- Actually continuous use of pharmacological agents that are known to lower the seizure
threshold or augment or decrease the alcohol withdrawal syndrome.

- Subjects with known sensitivity of previous adverse reaction to diazepam or clonidine

- Contra-indication or known non-response to diazepam or clonidine
</textblock>
</criteria>
<gender>All</gender>
<minimum_age>18 Years</minimum_age>
<maximum_age>65 Years</maximum_age>
<healthy_volunteers>No</healthy_volunteers>
</eligibility>
<overall_official>
<last_name>Martin Schaefer, MD</last_name>
<role>Principal Investigator</role>
<affiliation>Charité Campus Mitte, Klinik für Psychiatrie und Psychotherapie</affiliation>
</overall_official>
<location>
<facility>
<name>MLU Halle-Wittenberg</name>
<address>
<city>Halle</city>
<state>Sachen/Anhalt</state>
<zip>06097</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location>
<facility>
<name>Charité - Universitätsmedizin Berlin, Campus Charité Mitte, Klinik für Psychiatrie und Psychotherapie</name>
<address>
<city>Berlin</city>
<zip>10117</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location>
<facility>
<name>Psychiatrische Klinik der Charité im St.-Hedwig Krankenhaus</name>
<address>
<city>Berlin</city>
<zip>10559</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location>
<facility>
<name>Klinik für Psychiatrie und Suchtmedizin, Kliniken Essen Mitte</name>
<address>
<city>Essen</city>
<zip>45136</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location>
<facility>
<name>Zentrum für Seelische Gesundheit</name>
<address>
<city>Rhede</city>
<zip>46414</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location_countries>
<country>Germany</country>
</location_countries>
<reference>
<citation>Krebs M, Leopold K, Richter C, Kienast T, Hinzpeter A, Heinz A, Schaefer M. Levetiracetam for the treatment of alcohol withdrawal syndrome: an open-label pilot trial. J Clin Psychopharmacol. 2006 Jun;26(3):347-9.</citation>
<PMID>16702910</PMID>
</reference>
<verification_date>September 2008</verification_date>
<lastchanged_date>December 29, 2009</lastchanged_date>
<firstreceived_date>September 6, 2005</firstreceived_date>
<responsible_party>
<name_title>Martin Schaefer, MD</name_title>
<organization>Charite University, Berlin, Germany</organization>
</responsible_party>
<keyword>alcohol withdrawal</keyword>
<keyword>detoxification</keyword>
<keyword>Inpatients</keyword>
<keyword>alcohol dependence according to DSM-IV/ICD-10</keyword>
<keyword>withdrawal symptoms</keyword>
<condition_browse>
<!-- CAUTION: The following MeSH terms are assigned with an imperfect algorithm -->
<mesh_term>Syndrome</mesh_term>
<mesh_term>Substance Withdrawal Syndrome</mesh_term>
</condition_browse>
<intervention_browse>
<!-- CAUTION: The following MeSH terms are assigned with an imperfect algorithm -->
<mesh_term>Ethanol</mesh_term>
<mesh_term>Diazepam</mesh_term>
<mesh_term>Etiracetam</mesh_term>
<mesh_term>Piracetam</mesh_term>
</intervention_browse>
<!-- Results have not yet been posted for this study -->
</clinical_study>


So they all use the same tags and i need a few of them like:




  • overall_official

  • lead_sponsor

  • official_title

  • results_reference

  • overall_status


So far i tried with the following code:



    @echo off
setlocal enabledelayedexpansion
for %%a in (*.xml) do (
call :XMLExtract "%%a" "<results_reference>" location
echo.!location!,%%~na
)
exit /b

:XMLExtract file keystart location
@echo off & setlocal
for /f "tokens=3 delims=<>" %%a in ('Findstr /i /c:%2 "%~1"') do (
set "loc=%%a" & goto :endloop
)
:endLoop
ENDLOCAL & IF "%~3" NEQ "" (SET %~3=%loc%) ELSE echo.%loc%
exit /b


I ran the batch in the command line as: bat >> output.txt or output.csv and it worked perfectly for the overall_status, but with all of the other tags there are problems e.g.:




  • overall_offical: It stops after like 10 of them

  • other tags: The file names are listed (as always), but with no information behind it.


I would really appreciate any help on how this can be fixed or another way to efficiently solve this task. I only have a small, basic understanding of programming, but i am sure to be able to work myself into any easy solutions. The best help would be a way to optimize the batch code to fit this. If there is some information missing i am sorry and i will provide it.










share|improve this question













I need help on the optimization of a batch-file to get multiple xml tags of over a thousand xml files into a .txt or .csv.



The .xml's are all in the same format. They are clinical studies and look like this:



    <?xml version="1.0" encoding="UTF-8"?>
<clinical_study rank="373">
<!-- This xml conforms to an XML Schema at:
https://clinicaltrials.gov/ct2/html/images/info/public.xsd -->
<required_header>
<download_date>ClinicalTrials.gov processed this data on May 25, 2017</download_date>
<link_text>Link to the current ClinicalTrials.gov record.</link_text>
<url>https://clinicaltrials.gov/show/NCT00146471</url>
</required_header>
<id_info>
<org_study_id>Kep-F10.3.01</org_study_id>
<nct_id>NCT00146471</nct_id>
</id_info>
<brief_title>Efficacy and Safety of Levetiracetam in the Inpatient Treatment of Alcohol Withdrawal Syndrome</brief_title>
<official_title>Efficacy and Safety of Levetiracetam in the Inpatient Treatment of Alcohol Withdrawal Syndrome [Sicherheit Und Wirksamkeit Von Levetiracetam (Keppra) für Die Behandlung Des stationären Alkoholentzugsyndroms]</official_title>
<sponsors>
<lead_sponsor>
<agency>Charite University, Berlin, Germany</agency>
<agency_class>Other</agency_class>
</lead_sponsor>
</sponsors>
<source>Charite University, Berlin, Germany</source>
<oversight_info>
<has_dmc>Yes</has_dmc>
</oversight_info>
<brief_summary>
<textblock>
The purpose of this study is to evaluate the efficacy and safety of levetiracetam for
treating alcohol withdrawal syndrome (AWS) in inpatients (vs. placebo). The primary come-out
parameter is the reduction of the total needed amount of diazepam for add-on treatment of
acute alcohol withdrawal symptoms. The secondary come-out parameter are - safety criteria
(AE) - reduction of alcohol withdrawal score over the days.
</textblock>
</brief_summary>
<overall_status>Completed</overall_status>
<start_date>January 2006</start_date>
<completion_date type="Actual">September 2007</completion_date>
<primary_completion_date type="Actual">July 2007</primary_completion_date>
<phase>Phase 3</phase>
<study_type>Interventional</study_type>
<has_expanded_access>No</has_expanded_access>
<study_design_info>
<allocation>Randomized</allocation>
<intervention_model>Parallel Assignment</intervention_model>
<primary_purpose>Treatment</primary_purpose>
<masking>Double Blind (Participant, Care Provider, Investigator)</masking>
</study_design_info>
<primary_outcome>
<measure>To evaluate the efficacy and safety of levetiracetam for treating alcohol withdrawal syndrome in inpatients. The primary come-out parameter is the reduction of the amount of diazepam for add-on treatment of acute alcohol withdrawal</measure>
<time_frame>during trial</time_frame>
</primary_outcome>
<secondary_outcome>
<measure>Secondary come-out parameters are - safety criteria (AE) - reduction of alcohol withdrawal score over the days</measure>
<time_frame>during trial</time_frame>
</secondary_outcome>
<number_of_arms>2</number_of_arms>
<enrollment type="Actual">120</enrollment>
<condition>Alcohol Withdrawal Syndrome</condition>
<arm_group>
<arm_group_label>2</arm_group_label>
<arm_group_type>Active Comparator</arm_group_type>
</arm_group>
<arm_group>
<arm_group_label>1: Diazepam plus Placebo</arm_group_label>
<arm_group_type>Placebo Comparator</arm_group_type>
</arm_group>
<intervention>
<intervention_type>Drug</intervention_type>
<intervention_name>Levetiracetam</intervention_name>
<description>1500-2000 mg daily add-on or Placebo Diazepam as needed</description>
<arm_group_label>2</arm_group_label>
<other_name>KEPPRA</other_name>
</intervention>
<intervention>
<intervention_type>Drug</intervention_type>
<intervention_name>Placebo</intervention_name>
<description>1500-2000 mg daily add-on or Placebo Diazepam as needed</description>
<arm_group_label>1: Diazepam plus Placebo</arm_group_label>
</intervention>
<eligibility>
<criteria>
<textblock>
Inclusion Criteria:

- Ages eligible for study: 18-65 years.

- Meets criteria for alcohol dependence according to DSM-IV/ICD-10

- Known withdrawal symptoms in the past in case of discontinuation of alcohol
consumption

- Hospital admission for alcohol detoxification

- Able to provide a written informed consent.

- Able to follow verbal and written instructions (incl. a sufficient knowledge of
German language).

- Must be medically acceptable for study treatment. No past or present physical
disorder that is likely to deteriorate during participation. No ECG abnormality which
would likely worsen during participation and no clinical laboratory abnormality that
would also suggest deterioration during treatment.

- Have a negative urine drug screen for benzodiazepines or heroine or methadone

Exclusion Criteria:

- Current diagnosis of any other substance dependence syndrome other than alcohol
dependence (excluding nicotine and caffeine dependence).

- History of idiopathic epilepsy.

- Patient with any current clinically significant psychiatric disorder (acute
suiciality) or developmental disorder (including organic mental disorder), like
psychotic disorders.

- Patients with the following complications of alcoholism (lifetime): acute delirium
tremens, hallucinatory alcoholic state, Korsakoff`s syndrome, Wernicke
encephalopathy, decomposed liver cirrhosis (Child B, C), suspected cirrhosis with the
following clinical symptoms detected at clinical exam: signs of portal hypertension
and signs of hepato-cellular failure, thrombocytopenia.

- Subjects with known sensitivity of previous adverse reaction to levetiracetam

- Contra-indication (hypersensitivity to levetiracetam or pyrrolidone derivatives) or
known non-response to levetiracetam.

- History of severe GI disease which might render absorption of the medication
difficult or produce medical instability of the patient which would include active
peptic ulcer disease, ulcerative colitis, regional colitis, or evidence by history or
physical exam of GI bleeding.

- Patients with any clinically significant acute or chronic progressive neurological,
gastrointestinal, cardiovascular, hepatic, renal, haematological, endocrine,
dermatological or respiratory disease, such as diabetes, severe infection, acute
alcoholic hepatitis, or any other medical condition with significant worsening of the
clinical situation of the patient that might interfere with the evaluation of study
medication.

- Female patients pregnant, breast-feeding or of child bearing age and not protected by
effective contraceptive such as implants, injectables, combined oral contraceptives,
some IUDS, sexual abstinence, sterilization or vasectomized partner.

- Actually continuous use of pharmacological agents that are known to lower the seizure
threshold or augment or decrease the alcohol withdrawal syndrome.

- Subjects with known sensitivity of previous adverse reaction to diazepam or clonidine

- Contra-indication or known non-response to diazepam or clonidine
</textblock>
</criteria>
<gender>All</gender>
<minimum_age>18 Years</minimum_age>
<maximum_age>65 Years</maximum_age>
<healthy_volunteers>No</healthy_volunteers>
</eligibility>
<overall_official>
<last_name>Martin Schaefer, MD</last_name>
<role>Principal Investigator</role>
<affiliation>Charité Campus Mitte, Klinik für Psychiatrie und Psychotherapie</affiliation>
</overall_official>
<location>
<facility>
<name>MLU Halle-Wittenberg</name>
<address>
<city>Halle</city>
<state>Sachen/Anhalt</state>
<zip>06097</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location>
<facility>
<name>Charité - Universitätsmedizin Berlin, Campus Charité Mitte, Klinik für Psychiatrie und Psychotherapie</name>
<address>
<city>Berlin</city>
<zip>10117</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location>
<facility>
<name>Psychiatrische Klinik der Charité im St.-Hedwig Krankenhaus</name>
<address>
<city>Berlin</city>
<zip>10559</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location>
<facility>
<name>Klinik für Psychiatrie und Suchtmedizin, Kliniken Essen Mitte</name>
<address>
<city>Essen</city>
<zip>45136</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location>
<facility>
<name>Zentrum für Seelische Gesundheit</name>
<address>
<city>Rhede</city>
<zip>46414</zip>
<country>Germany</country>
</address>
</facility>
</location>
<location_countries>
<country>Germany</country>
</location_countries>
<reference>
<citation>Krebs M, Leopold K, Richter C, Kienast T, Hinzpeter A, Heinz A, Schaefer M. Levetiracetam for the treatment of alcohol withdrawal syndrome: an open-label pilot trial. J Clin Psychopharmacol. 2006 Jun;26(3):347-9.</citation>
<PMID>16702910</PMID>
</reference>
<verification_date>September 2008</verification_date>
<lastchanged_date>December 29, 2009</lastchanged_date>
<firstreceived_date>September 6, 2005</firstreceived_date>
<responsible_party>
<name_title>Martin Schaefer, MD</name_title>
<organization>Charite University, Berlin, Germany</organization>
</responsible_party>
<keyword>alcohol withdrawal</keyword>
<keyword>detoxification</keyword>
<keyword>Inpatients</keyword>
<keyword>alcohol dependence according to DSM-IV/ICD-10</keyword>
<keyword>withdrawal symptoms</keyword>
<condition_browse>
<!-- CAUTION: The following MeSH terms are assigned with an imperfect algorithm -->
<mesh_term>Syndrome</mesh_term>
<mesh_term>Substance Withdrawal Syndrome</mesh_term>
</condition_browse>
<intervention_browse>
<!-- CAUTION: The following MeSH terms are assigned with an imperfect algorithm -->
<mesh_term>Ethanol</mesh_term>
<mesh_term>Diazepam</mesh_term>
<mesh_term>Etiracetam</mesh_term>
<mesh_term>Piracetam</mesh_term>
</intervention_browse>
<!-- Results have not yet been posted for this study -->
</clinical_study>


So they all use the same tags and i need a few of them like:




  • overall_official

  • lead_sponsor

  • official_title

  • results_reference

  • overall_status


So far i tried with the following code:



    @echo off
setlocal enabledelayedexpansion
for %%a in (*.xml) do (
call :XMLExtract "%%a" "<results_reference>" location
echo.!location!,%%~na
)
exit /b

:XMLExtract file keystart location
@echo off & setlocal
for /f "tokens=3 delims=<>" %%a in ('Findstr /i /c:%2 "%~1"') do (
set "loc=%%a" & goto :endloop
)
:endLoop
ENDLOCAL & IF "%~3" NEQ "" (SET %~3=%loc%) ELSE echo.%loc%
exit /b


I ran the batch in the command line as: bat >> output.txt or output.csv and it worked perfectly for the overall_status, but with all of the other tags there are problems e.g.:




  • overall_offical: It stops after like 10 of them

  • other tags: The file names are listed (as always), but with no information behind it.


I would really appreciate any help on how this can be fixed or another way to efficiently solve this task. I only have a small, basic understanding of programming, but i am sure to be able to work myself into any easy solutions. The best help would be a way to optimize the batch code to fit this. If there is some information missing i am sorry and i will provide it.







xml batch-file






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked May 27 '17 at 22:44









Lew Myschkin

31




31












  • I don't think one can set the %3 as it is the argument.
    – SteveFest
    May 28 '17 at 0:58










  • Let me recommend to use a language that natively supports XML format for manipulating XML data, because pure batch scripting may easily violate the specifications and make the data inaccessible...
    – aschipfl
    May 29 '17 at 7:01




















  • I don't think one can set the %3 as it is the argument.
    – SteveFest
    May 28 '17 at 0:58










  • Let me recommend to use a language that natively supports XML format for manipulating XML data, because pure batch scripting may easily violate the specifications and make the data inaccessible...
    – aschipfl
    May 29 '17 at 7:01


















I don't think one can set the %3 as it is the argument.
– SteveFest
May 28 '17 at 0:58




I don't think one can set the %3 as it is the argument.
– SteveFest
May 28 '17 at 0:58












Let me recommend to use a language that natively supports XML format for manipulating XML data, because pure batch scripting may easily violate the specifications and make the data inaccessible...
– aschipfl
May 29 '17 at 7:01






Let me recommend to use a language that natively supports XML format for manipulating XML data, because pure batch scripting may easily violate the specifications and make the data inaccessible...
– aschipfl
May 29 '17 at 7:01














2 Answers
2






active

oldest

votes

















up vote
0
down vote



accepted










@ECHO Off
SETLOCAL
SET "sourcedir=U:sourcedir"
SET "destdir=U:destdir"
:: SET "tags=overall_official lead_sponsor official_title results_reference overall_status"
SET "tags=%*"

FOR /f "tokens=1delims=" %%a IN (
'dir /b /a-d "%sourcedir%*.xml" '
) DO (
REM Clear detected-tags flags for each file "%%a"
FOR %%t IN (%tags% malformed) DO SET "%%t="
REM remove "rem" from following line to delete any existing result file
REM del "%destdir%%%~na.txt" >nul 2>nul
REM Read each line to %%L - usebackq to allow "quoted filenames"
FOR /f "usebackqdelims=" %%L IN ("%sourcedir%%%a") DO (
REM remove leading spaces from %%L into %%P
FOR /f "tokens=*" %%P IN ("%%L") DO (
REM tokenise on "<>"
FOR /f "tokens=1-3*delims=<>" %%w IN ("%%P") DO (
IF "%%z" neq "" SET "malformed=%%z"
FOR %%t IN (%tags%) DO IF "%%w"=="%%t" (SET "%%t=Y") else IF "%%w"=="/%%t" (SET "%%t=")
SET "report="
FOR %%t IN (%tags%) DO IF DEFINED %%t SET "report=Y"
REM (1 of 2) un-rem this to deposit in individual filenames
REM (
IF DEFINED report (
REM we may have 1,2 or 3 tokens
REM if 3, output token 2
REM if 2, output token 1 if token 2 starts "/", token 2 otherwise
REM if only 1, output entire line unless it is a target token
IF "%%y" equ "" (
IF "%%x" equ "" (
REM only one token
FOR %%t IN (%tags%) DO IF "%%w"=="%%t" (SET "report=") else IF "%%w"=="/%%t" (SET "report=")
IF DEFINED report ECHO %%L
) ELSE (
REM two tokens
ECHO %%x|FINDSTR /b "/">NUL 2>NUL
IF ERRORLEVEL 1 (ECHO %%x) ELSE (ECHO %%w)
)
) ELSE (ECHO %%x)
)
REM (2 of 2) un-rem this to deposit in individual filenames
REM )>>"%destdir%%%~na.txt"
FOR %%t IN (%tags%) DO IF "%%y"=="/%%t" (SET "%%t=")
FOR %%t IN (%tags%) DO IF "%%x"=="/%%t" (SET "%%t=")
)
REM pause
)
)
)

GOTO :EOF


You would need to change the settings of sourcedir and destdir to suit your circumstances.



This may give you some ideas. You haven't provided an output sample, so perhaps you'd want to prefix each output line with the source filename (in %%~na) in the appropriate echos



Expected syntax to run:




thisbatchname tag tag tag




My approach is to have %%a contain the filename to be processed, %%L the raw line data from the file and %%P the raw line data with leading spaces stripped.



Tokenising %%P using the delimiters yields %%W to %%z as each line contains 1-3 possible elements - tags or data. If there is a fourth, then there's something wrong (the flag malformed is set for the file, although I didn't do anything with it - it will contain the text where the problem lies[could also have been set to %%P for the entire line...])



So, using the required-tags as variable names, simply set those varnames to nothing or something and use if defined to interpret their state - which operates on their run-time status as the data changes line-by-line.



Note that as the entire operational part of the code is one gargantuan code-block, rem and not :: must be used for helpful remarks.



Also note that



(
commands
)>file


will redirect the output of commands according to the redirector specified (if required)






share|improve this answer





















  • Thank you very much Magoo, this helps a lot! The code works exactly the way you put it. I got an additional question though. How could i have the output be in a way that it also shows the tag like: tag -> information or (even better): a csv-file that doesn't put every word in an own column, but puts a whole tag in a column? So, in the end i want one file, that includes an overview of all the information.
    – Lew Myschkin
    May 28 '17 at 14:02










  • If you want the tags as well, simply echo %%P or echo %%L instead of echoing %%w..%%y
    – Magoo
    May 28 '17 at 14:53










  • Great! Thank you :D
    – Lew Myschkin
    May 28 '17 at 15:37


















up vote
0
down vote













try with xpath.bat:



for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//reference/citation"') do set "reference_citation=%%#"
echo %reference_citation%

for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//official_title"') do set "official_title=%%#"
echo %official_title%

for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//lead_sponsor/agency"') do set "lead_sponsor=%%#"
echo %lead_sponsor%

for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//overall_official"') do set "overall_official=%%#"
echo %overall_official%





share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44222245%2fbatch-file-to-extract-the-value-of-xml-tags-of-many-xml-files%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    @ECHO Off
    SETLOCAL
    SET "sourcedir=U:sourcedir"
    SET "destdir=U:destdir"
    :: SET "tags=overall_official lead_sponsor official_title results_reference overall_status"
    SET "tags=%*"

    FOR /f "tokens=1delims=" %%a IN (
    'dir /b /a-d "%sourcedir%*.xml" '
    ) DO (
    REM Clear detected-tags flags for each file "%%a"
    FOR %%t IN (%tags% malformed) DO SET "%%t="
    REM remove "rem" from following line to delete any existing result file
    REM del "%destdir%%%~na.txt" >nul 2>nul
    REM Read each line to %%L - usebackq to allow "quoted filenames"
    FOR /f "usebackqdelims=" %%L IN ("%sourcedir%%%a") DO (
    REM remove leading spaces from %%L into %%P
    FOR /f "tokens=*" %%P IN ("%%L") DO (
    REM tokenise on "<>"
    FOR /f "tokens=1-3*delims=<>" %%w IN ("%%P") DO (
    IF "%%z" neq "" SET "malformed=%%z"
    FOR %%t IN (%tags%) DO IF "%%w"=="%%t" (SET "%%t=Y") else IF "%%w"=="/%%t" (SET "%%t=")
    SET "report="
    FOR %%t IN (%tags%) DO IF DEFINED %%t SET "report=Y"
    REM (1 of 2) un-rem this to deposit in individual filenames
    REM (
    IF DEFINED report (
    REM we may have 1,2 or 3 tokens
    REM if 3, output token 2
    REM if 2, output token 1 if token 2 starts "/", token 2 otherwise
    REM if only 1, output entire line unless it is a target token
    IF "%%y" equ "" (
    IF "%%x" equ "" (
    REM only one token
    FOR %%t IN (%tags%) DO IF "%%w"=="%%t" (SET "report=") else IF "%%w"=="/%%t" (SET "report=")
    IF DEFINED report ECHO %%L
    ) ELSE (
    REM two tokens
    ECHO %%x|FINDSTR /b "/">NUL 2>NUL
    IF ERRORLEVEL 1 (ECHO %%x) ELSE (ECHO %%w)
    )
    ) ELSE (ECHO %%x)
    )
    REM (2 of 2) un-rem this to deposit in individual filenames
    REM )>>"%destdir%%%~na.txt"
    FOR %%t IN (%tags%) DO IF "%%y"=="/%%t" (SET "%%t=")
    FOR %%t IN (%tags%) DO IF "%%x"=="/%%t" (SET "%%t=")
    )
    REM pause
    )
    )
    )

    GOTO :EOF


    You would need to change the settings of sourcedir and destdir to suit your circumstances.



    This may give you some ideas. You haven't provided an output sample, so perhaps you'd want to prefix each output line with the source filename (in %%~na) in the appropriate echos



    Expected syntax to run:




    thisbatchname tag tag tag




    My approach is to have %%a contain the filename to be processed, %%L the raw line data from the file and %%P the raw line data with leading spaces stripped.



    Tokenising %%P using the delimiters yields %%W to %%z as each line contains 1-3 possible elements - tags or data. If there is a fourth, then there's something wrong (the flag malformed is set for the file, although I didn't do anything with it - it will contain the text where the problem lies[could also have been set to %%P for the entire line...])



    So, using the required-tags as variable names, simply set those varnames to nothing or something and use if defined to interpret their state - which operates on their run-time status as the data changes line-by-line.



    Note that as the entire operational part of the code is one gargantuan code-block, rem and not :: must be used for helpful remarks.



    Also note that



    (
    commands
    )>file


    will redirect the output of commands according to the redirector specified (if required)






    share|improve this answer





















    • Thank you very much Magoo, this helps a lot! The code works exactly the way you put it. I got an additional question though. How could i have the output be in a way that it also shows the tag like: tag -> information or (even better): a csv-file that doesn't put every word in an own column, but puts a whole tag in a column? So, in the end i want one file, that includes an overview of all the information.
      – Lew Myschkin
      May 28 '17 at 14:02










    • If you want the tags as well, simply echo %%P or echo %%L instead of echoing %%w..%%y
      – Magoo
      May 28 '17 at 14:53










    • Great! Thank you :D
      – Lew Myschkin
      May 28 '17 at 15:37















    up vote
    0
    down vote



    accepted










    @ECHO Off
    SETLOCAL
    SET "sourcedir=U:sourcedir"
    SET "destdir=U:destdir"
    :: SET "tags=overall_official lead_sponsor official_title results_reference overall_status"
    SET "tags=%*"

    FOR /f "tokens=1delims=" %%a IN (
    'dir /b /a-d "%sourcedir%*.xml" '
    ) DO (
    REM Clear detected-tags flags for each file "%%a"
    FOR %%t IN (%tags% malformed) DO SET "%%t="
    REM remove "rem" from following line to delete any existing result file
    REM del "%destdir%%%~na.txt" >nul 2>nul
    REM Read each line to %%L - usebackq to allow "quoted filenames"
    FOR /f "usebackqdelims=" %%L IN ("%sourcedir%%%a") DO (
    REM remove leading spaces from %%L into %%P
    FOR /f "tokens=*" %%P IN ("%%L") DO (
    REM tokenise on "<>"
    FOR /f "tokens=1-3*delims=<>" %%w IN ("%%P") DO (
    IF "%%z" neq "" SET "malformed=%%z"
    FOR %%t IN (%tags%) DO IF "%%w"=="%%t" (SET "%%t=Y") else IF "%%w"=="/%%t" (SET "%%t=")
    SET "report="
    FOR %%t IN (%tags%) DO IF DEFINED %%t SET "report=Y"
    REM (1 of 2) un-rem this to deposit in individual filenames
    REM (
    IF DEFINED report (
    REM we may have 1,2 or 3 tokens
    REM if 3, output token 2
    REM if 2, output token 1 if token 2 starts "/", token 2 otherwise
    REM if only 1, output entire line unless it is a target token
    IF "%%y" equ "" (
    IF "%%x" equ "" (
    REM only one token
    FOR %%t IN (%tags%) DO IF "%%w"=="%%t" (SET "report=") else IF "%%w"=="/%%t" (SET "report=")
    IF DEFINED report ECHO %%L
    ) ELSE (
    REM two tokens
    ECHO %%x|FINDSTR /b "/">NUL 2>NUL
    IF ERRORLEVEL 1 (ECHO %%x) ELSE (ECHO %%w)
    )
    ) ELSE (ECHO %%x)
    )
    REM (2 of 2) un-rem this to deposit in individual filenames
    REM )>>"%destdir%%%~na.txt"
    FOR %%t IN (%tags%) DO IF "%%y"=="/%%t" (SET "%%t=")
    FOR %%t IN (%tags%) DO IF "%%x"=="/%%t" (SET "%%t=")
    )
    REM pause
    )
    )
    )

    GOTO :EOF


    You would need to change the settings of sourcedir and destdir to suit your circumstances.



    This may give you some ideas. You haven't provided an output sample, so perhaps you'd want to prefix each output line with the source filename (in %%~na) in the appropriate echos



    Expected syntax to run:




    thisbatchname tag tag tag




    My approach is to have %%a contain the filename to be processed, %%L the raw line data from the file and %%P the raw line data with leading spaces stripped.



    Tokenising %%P using the delimiters yields %%W to %%z as each line contains 1-3 possible elements - tags or data. If there is a fourth, then there's something wrong (the flag malformed is set for the file, although I didn't do anything with it - it will contain the text where the problem lies[could also have been set to %%P for the entire line...])



    So, using the required-tags as variable names, simply set those varnames to nothing or something and use if defined to interpret their state - which operates on their run-time status as the data changes line-by-line.



    Note that as the entire operational part of the code is one gargantuan code-block, rem and not :: must be used for helpful remarks.



    Also note that



    (
    commands
    )>file


    will redirect the output of commands according to the redirector specified (if required)






    share|improve this answer





















    • Thank you very much Magoo, this helps a lot! The code works exactly the way you put it. I got an additional question though. How could i have the output be in a way that it also shows the tag like: tag -> information or (even better): a csv-file that doesn't put every word in an own column, but puts a whole tag in a column? So, in the end i want one file, that includes an overview of all the information.
      – Lew Myschkin
      May 28 '17 at 14:02










    • If you want the tags as well, simply echo %%P or echo %%L instead of echoing %%w..%%y
      – Magoo
      May 28 '17 at 14:53










    • Great! Thank you :D
      – Lew Myschkin
      May 28 '17 at 15:37













    up vote
    0
    down vote



    accepted







    up vote
    0
    down vote



    accepted






    @ECHO Off
    SETLOCAL
    SET "sourcedir=U:sourcedir"
    SET "destdir=U:destdir"
    :: SET "tags=overall_official lead_sponsor official_title results_reference overall_status"
    SET "tags=%*"

    FOR /f "tokens=1delims=" %%a IN (
    'dir /b /a-d "%sourcedir%*.xml" '
    ) DO (
    REM Clear detected-tags flags for each file "%%a"
    FOR %%t IN (%tags% malformed) DO SET "%%t="
    REM remove "rem" from following line to delete any existing result file
    REM del "%destdir%%%~na.txt" >nul 2>nul
    REM Read each line to %%L - usebackq to allow "quoted filenames"
    FOR /f "usebackqdelims=" %%L IN ("%sourcedir%%%a") DO (
    REM remove leading spaces from %%L into %%P
    FOR /f "tokens=*" %%P IN ("%%L") DO (
    REM tokenise on "<>"
    FOR /f "tokens=1-3*delims=<>" %%w IN ("%%P") DO (
    IF "%%z" neq "" SET "malformed=%%z"
    FOR %%t IN (%tags%) DO IF "%%w"=="%%t" (SET "%%t=Y") else IF "%%w"=="/%%t" (SET "%%t=")
    SET "report="
    FOR %%t IN (%tags%) DO IF DEFINED %%t SET "report=Y"
    REM (1 of 2) un-rem this to deposit in individual filenames
    REM (
    IF DEFINED report (
    REM we may have 1,2 or 3 tokens
    REM if 3, output token 2
    REM if 2, output token 1 if token 2 starts "/", token 2 otherwise
    REM if only 1, output entire line unless it is a target token
    IF "%%y" equ "" (
    IF "%%x" equ "" (
    REM only one token
    FOR %%t IN (%tags%) DO IF "%%w"=="%%t" (SET "report=") else IF "%%w"=="/%%t" (SET "report=")
    IF DEFINED report ECHO %%L
    ) ELSE (
    REM two tokens
    ECHO %%x|FINDSTR /b "/">NUL 2>NUL
    IF ERRORLEVEL 1 (ECHO %%x) ELSE (ECHO %%w)
    )
    ) ELSE (ECHO %%x)
    )
    REM (2 of 2) un-rem this to deposit in individual filenames
    REM )>>"%destdir%%%~na.txt"
    FOR %%t IN (%tags%) DO IF "%%y"=="/%%t" (SET "%%t=")
    FOR %%t IN (%tags%) DO IF "%%x"=="/%%t" (SET "%%t=")
    )
    REM pause
    )
    )
    )

    GOTO :EOF


    You would need to change the settings of sourcedir and destdir to suit your circumstances.



    This may give you some ideas. You haven't provided an output sample, so perhaps you'd want to prefix each output line with the source filename (in %%~na) in the appropriate echos



    Expected syntax to run:




    thisbatchname tag tag tag




    My approach is to have %%a contain the filename to be processed, %%L the raw line data from the file and %%P the raw line data with leading spaces stripped.



    Tokenising %%P using the delimiters yields %%W to %%z as each line contains 1-3 possible elements - tags or data. If there is a fourth, then there's something wrong (the flag malformed is set for the file, although I didn't do anything with it - it will contain the text where the problem lies[could also have been set to %%P for the entire line...])



    So, using the required-tags as variable names, simply set those varnames to nothing or something and use if defined to interpret their state - which operates on their run-time status as the data changes line-by-line.



    Note that as the entire operational part of the code is one gargantuan code-block, rem and not :: must be used for helpful remarks.



    Also note that



    (
    commands
    )>file


    will redirect the output of commands according to the redirector specified (if required)






    share|improve this answer












    @ECHO Off
    SETLOCAL
    SET "sourcedir=U:sourcedir"
    SET "destdir=U:destdir"
    :: SET "tags=overall_official lead_sponsor official_title results_reference overall_status"
    SET "tags=%*"

    FOR /f "tokens=1delims=" %%a IN (
    'dir /b /a-d "%sourcedir%*.xml" '
    ) DO (
    REM Clear detected-tags flags for each file "%%a"
    FOR %%t IN (%tags% malformed) DO SET "%%t="
    REM remove "rem" from following line to delete any existing result file
    REM del "%destdir%%%~na.txt" >nul 2>nul
    REM Read each line to %%L - usebackq to allow "quoted filenames"
    FOR /f "usebackqdelims=" %%L IN ("%sourcedir%%%a") DO (
    REM remove leading spaces from %%L into %%P
    FOR /f "tokens=*" %%P IN ("%%L") DO (
    REM tokenise on "<>"
    FOR /f "tokens=1-3*delims=<>" %%w IN ("%%P") DO (
    IF "%%z" neq "" SET "malformed=%%z"
    FOR %%t IN (%tags%) DO IF "%%w"=="%%t" (SET "%%t=Y") else IF "%%w"=="/%%t" (SET "%%t=")
    SET "report="
    FOR %%t IN (%tags%) DO IF DEFINED %%t SET "report=Y"
    REM (1 of 2) un-rem this to deposit in individual filenames
    REM (
    IF DEFINED report (
    REM we may have 1,2 or 3 tokens
    REM if 3, output token 2
    REM if 2, output token 1 if token 2 starts "/", token 2 otherwise
    REM if only 1, output entire line unless it is a target token
    IF "%%y" equ "" (
    IF "%%x" equ "" (
    REM only one token
    FOR %%t IN (%tags%) DO IF "%%w"=="%%t" (SET "report=") else IF "%%w"=="/%%t" (SET "report=")
    IF DEFINED report ECHO %%L
    ) ELSE (
    REM two tokens
    ECHO %%x|FINDSTR /b "/">NUL 2>NUL
    IF ERRORLEVEL 1 (ECHO %%x) ELSE (ECHO %%w)
    )
    ) ELSE (ECHO %%x)
    )
    REM (2 of 2) un-rem this to deposit in individual filenames
    REM )>>"%destdir%%%~na.txt"
    FOR %%t IN (%tags%) DO IF "%%y"=="/%%t" (SET "%%t=")
    FOR %%t IN (%tags%) DO IF "%%x"=="/%%t" (SET "%%t=")
    )
    REM pause
    )
    )
    )

    GOTO :EOF


    You would need to change the settings of sourcedir and destdir to suit your circumstances.



    This may give you some ideas. You haven't provided an output sample, so perhaps you'd want to prefix each output line with the source filename (in %%~na) in the appropriate echos



    Expected syntax to run:




    thisbatchname tag tag tag




    My approach is to have %%a contain the filename to be processed, %%L the raw line data from the file and %%P the raw line data with leading spaces stripped.



    Tokenising %%P using the delimiters yields %%W to %%z as each line contains 1-3 possible elements - tags or data. If there is a fourth, then there's something wrong (the flag malformed is set for the file, although I didn't do anything with it - it will contain the text where the problem lies[could also have been set to %%P for the entire line...])



    So, using the required-tags as variable names, simply set those varnames to nothing or something and use if defined to interpret their state - which operates on their run-time status as the data changes line-by-line.



    Note that as the entire operational part of the code is one gargantuan code-block, rem and not :: must be used for helpful remarks.



    Also note that



    (
    commands
    )>file


    will redirect the output of commands according to the redirector specified (if required)







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered May 28 '17 at 5:15









    Magoo

    59.7k53968




    59.7k53968












    • Thank you very much Magoo, this helps a lot! The code works exactly the way you put it. I got an additional question though. How could i have the output be in a way that it also shows the tag like: tag -> information or (even better): a csv-file that doesn't put every word in an own column, but puts a whole tag in a column? So, in the end i want one file, that includes an overview of all the information.
      – Lew Myschkin
      May 28 '17 at 14:02










    • If you want the tags as well, simply echo %%P or echo %%L instead of echoing %%w..%%y
      – Magoo
      May 28 '17 at 14:53










    • Great! Thank you :D
      – Lew Myschkin
      May 28 '17 at 15:37


















    • Thank you very much Magoo, this helps a lot! The code works exactly the way you put it. I got an additional question though. How could i have the output be in a way that it also shows the tag like: tag -> information or (even better): a csv-file that doesn't put every word in an own column, but puts a whole tag in a column? So, in the end i want one file, that includes an overview of all the information.
      – Lew Myschkin
      May 28 '17 at 14:02










    • If you want the tags as well, simply echo %%P or echo %%L instead of echoing %%w..%%y
      – Magoo
      May 28 '17 at 14:53










    • Great! Thank you :D
      – Lew Myschkin
      May 28 '17 at 15:37
















    Thank you very much Magoo, this helps a lot! The code works exactly the way you put it. I got an additional question though. How could i have the output be in a way that it also shows the tag like: tag -> information or (even better): a csv-file that doesn't put every word in an own column, but puts a whole tag in a column? So, in the end i want one file, that includes an overview of all the information.
    – Lew Myschkin
    May 28 '17 at 14:02




    Thank you very much Magoo, this helps a lot! The code works exactly the way you put it. I got an additional question though. How could i have the output be in a way that it also shows the tag like: tag -> information or (even better): a csv-file that doesn't put every word in an own column, but puts a whole tag in a column? So, in the end i want one file, that includes an overview of all the information.
    – Lew Myschkin
    May 28 '17 at 14:02












    If you want the tags as well, simply echo %%P or echo %%L instead of echoing %%w..%%y
    – Magoo
    May 28 '17 at 14:53




    If you want the tags as well, simply echo %%P or echo %%L instead of echoing %%w..%%y
    – Magoo
    May 28 '17 at 14:53












    Great! Thank you :D
    – Lew Myschkin
    May 28 '17 at 15:37




    Great! Thank you :D
    – Lew Myschkin
    May 28 '17 at 15:37












    up vote
    0
    down vote













    try with xpath.bat:



    for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//reference/citation"') do set "reference_citation=%%#"
    echo %reference_citation%

    for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//official_title"') do set "official_title=%%#"
    echo %official_title%

    for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//lead_sponsor/agency"') do set "lead_sponsor=%%#"
    echo %lead_sponsor%

    for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//overall_official"') do set "overall_official=%%#"
    echo %overall_official%





    share|improve this answer

























      up vote
      0
      down vote













      try with xpath.bat:



      for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//reference/citation"') do set "reference_citation=%%#"
      echo %reference_citation%

      for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//official_title"') do set "official_title=%%#"
      echo %official_title%

      for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//lead_sponsor/agency"') do set "lead_sponsor=%%#"
      echo %lead_sponsor%

      for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//overall_official"') do set "overall_official=%%#"
      echo %overall_official%





      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        try with xpath.bat:



        for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//reference/citation"') do set "reference_citation=%%#"
        echo %reference_citation%

        for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//official_title"') do set "official_title=%%#"
        echo %official_title%

        for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//lead_sponsor/agency"') do set "lead_sponsor=%%#"
        echo %lead_sponsor%

        for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//overall_official"') do set "overall_official=%%#"
        echo %overall_official%





        share|improve this answer












        try with xpath.bat:



        for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//reference/citation"') do set "reference_citation=%%#"
        echo %reference_citation%

        for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//official_title"') do set "official_title=%%#"
        echo %official_title%

        for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//lead_sponsor/agency"') do set "lead_sponsor=%%#"
        echo %lead_sponsor%

        for /f "tokens=* delims=" %%# in ('xpath.bat "study.xml" "//overall_official"') do set "overall_official=%%#"
        echo %overall_official%






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 10 at 22:30









        npocmaka

        41k1083125




        41k1083125






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f44222245%2fbatch-file-to-extract-the-value-of-xml-tags-of-many-xml-files%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            List item for chat from Array inside array React Native

            Thiostrepton

            Caerphilly