看板 Perl 關於我們 聯絡資訊
大家好,小弟有1000多個xml,檔名不定;xml結構相同 想要取出patientid 此TAG的值並rename原檔案為 000000001C.xml, 不知道是否可以指導一下小弟,非常感謝... file name:00b8e600-6875-11e1-4823-0019ddde0029.xml <patient criteriaversionforpatientdata="0A"> <generalpatientdata> <patientid>000000001C</patientid> <uniquepatientid/> <name> <lastname>中文字</lastname> <firstname> </firstname> <middlename/> </name> <age defaultage="50"> <dateofbirth>1953-10-14</dateofbirth> </age> <pacestatus>Unknown</pacestatus> <sex>Male</sex> <height> <cm/> </height> <weight> <kg/> </weight> </generalpatientdata> <patientmedicaldata> <bloodpressure> <systolic> <mmHg/> </systolic> <diastolic> <mmHg/> </diastolic> </bloodpressure> </patientmedicaldata> </patient> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.170.221.132
mmonkeyboyy:XML:Simple 04/12 03:02
mmonkeyboyy:拿出ID就可以了 另一種蠢方法就一行一行讀 04/12 03:05
iFEELing:一邊讀檔一邊RENAME要小心可能會炸... 04/14 15:06
mmonkeyboyy:建新檔再 system 'rm xxxxx' 04/15 20:59