1 に答える
2
<title>this title</title>
すべてがSINGLE 行にあることが確実な場合は、次のことを試してください。
Get-ChildItem -recurse | % {
((Get-Content .\test.xml) -match "<title>" -replace '<title>' -replace '</title>').Trim()
} | Set-Content protid_output.txt
彼らがより似ている場合:
<?xml version="1.0" encoding="ISO-8859-1"?>
<example>
<title>
protein name
</title>
</example>
次に、最初に xml-object に解析してみます (読みやすい) が、10 MB 以上のファイルは避けてください。例:
Get-ChildItem -Recurse | % {
$x = [xml](Get-Content $_)
$x.example.title.Trim()
} | Set-Content protid_output.txt
于 2013-04-10T18:17:01.020 に答える