S
sky
The output from running the following command is concatenated together, how do I add a new line to each result?
Here is the xml file:
<?xml version="1.0" encoding="UTF-8"?>
<digital_tpp cycle="1213" from_edate="0901Z 12/13/12" to_edate="0901Z 01/10/13">
<state_code ID="AK" state_fullname="Alaska">
<city_name ID="ADAK ISLAND" volume="AK-1">
<airport_name ID="ADAK" military="N" apt_ident="ADK" icao_ident="PADK" alnum="1244">
<record>
<chartseq>10100</chartseq>
<chart_code>MIN</chart_code>
<chart_name>TAKEOFF MINIMUMS</chart_name>
<useraction/>
<pdf_name>AKTO.PDF</pdf_name>
<cn_flg>N</cn_flg>
<cnsection/>
<cnpage/>
<bvsection>L</bvsection>
<bvpage/>
<procuid/>
<two_colored>N</two_colored>
<civil> </civil>
<faanfd15/>
<faanfd18/>
<copter/>
</record>
<record>
<chartseq>53525</chartseq>
<chart_code>IAP</chart_code>
<chart_name>RNAV (GPS) RWY 23</chart_name>
<useraction/>
<pdf_name>01244R23.PDF</pdf_name>
<cn_flg>N</cn_flg>
<cnsection/>
<cnpage/>
<bvsection> </bvsection>
<bvpage>1</bvpage>
<procuid>15177</procuid>
<two_colored>Y</two_colored>
<civil>C</civil>
<faanfd15>P23</faanfd15>
<faanfd18>R23</faanfd18>
<copter>N</copter>
</record>
<record>
<chartseq>57000</chartseq>
<chart_code>IAP</chart_code>
<chart_name>NDB/DME RWY 23</chart_name>
<useraction/>
<pdf_name>01244ND23.PDF</pdf_name>
<cn_flg>N</cn_flg>
<cnsection/>
<cnpage/>
<bvsection> </bvsection>
<bvpage>2</bvpage>
<procuid>15176</procuid>
<two_colored>Y</two_colored>
<civil>C</civil>
<faanfd15>N23</faanfd15>
<faanfd18>Q23</faanfd18>
<copter>N</copter>
</record>
</airport_name>
</city_name>
</state_code>
</digital_tpp>
Here is the command I'm running to select the value between the pdf_name tags
bash$ xmllint --xpath '//airport_name[@apt_ident="ADK"]/record[chart_code="IAP" or "DP" or "STAR" or "APD"]/pdf_name/text()' file.xml
Here is what the output looks like, as you can see it is missing new lines between the values returned, how do I add new lines?
AKTO.PDF01244R23.PDF01244ND23.PDFbash$
I want the output to look like this
AKTO.PDF
01244R23.PDF
01244ND23.PDF
Here is the xml file:
<?xml version="1.0" encoding="UTF-8"?>
<digital_tpp cycle="1213" from_edate="0901Z 12/13/12" to_edate="0901Z 01/10/13">
<state_code ID="AK" state_fullname="Alaska">
<city_name ID="ADAK ISLAND" volume="AK-1">
<airport_name ID="ADAK" military="N" apt_ident="ADK" icao_ident="PADK" alnum="1244">
<record>
<chartseq>10100</chartseq>
<chart_code>MIN</chart_code>
<chart_name>TAKEOFF MINIMUMS</chart_name>
<useraction/>
<pdf_name>AKTO.PDF</pdf_name>
<cn_flg>N</cn_flg>
<cnsection/>
<cnpage/>
<bvsection>L</bvsection>
<bvpage/>
<procuid/>
<two_colored>N</two_colored>
<civil> </civil>
<faanfd15/>
<faanfd18/>
<copter/>
</record>
<record>
<chartseq>53525</chartseq>
<chart_code>IAP</chart_code>
<chart_name>RNAV (GPS) RWY 23</chart_name>
<useraction/>
<pdf_name>01244R23.PDF</pdf_name>
<cn_flg>N</cn_flg>
<cnsection/>
<cnpage/>
<bvsection> </bvsection>
<bvpage>1</bvpage>
<procuid>15177</procuid>
<two_colored>Y</two_colored>
<civil>C</civil>
<faanfd15>P23</faanfd15>
<faanfd18>R23</faanfd18>
<copter>N</copter>
</record>
<record>
<chartseq>57000</chartseq>
<chart_code>IAP</chart_code>
<chart_name>NDB/DME RWY 23</chart_name>
<useraction/>
<pdf_name>01244ND23.PDF</pdf_name>
<cn_flg>N</cn_flg>
<cnsection/>
<cnpage/>
<bvsection> </bvsection>
<bvpage>2</bvpage>
<procuid>15176</procuid>
<two_colored>Y</two_colored>
<civil>C</civil>
<faanfd15>N23</faanfd15>
<faanfd18>Q23</faanfd18>
<copter>N</copter>
</record>
</airport_name>
</city_name>
</state_code>
</digital_tpp>
Here is the command I'm running to select the value between the pdf_name tags
bash$ xmllint --xpath '//airport_name[@apt_ident="ADK"]/record[chart_code="IAP" or "DP" or "STAR" or "APD"]/pdf_name/text()' file.xml
Here is what the output looks like, as you can see it is missing new lines between the values returned, how do I add new lines?
AKTO.PDF01244R23.PDF01244ND23.PDFbash$
I want the output to look like this
AKTO.PDF
01244R23.PDF
01244ND23.PDF