Tuesday, May 5, 2015

Unix Extract text between xml tags /anchors


Input:

<One>1</One>
<Two>2</Two>
<Three>3</Three>

Command:

sed -e 's/\(<[^<][^<]*>\)//g'  input.xml > output.txt

cat output.txt

1
2
3

No comments:

Post a Comment