DJo
DJo

Reputation: 2177

Split lines in a file using shell script

Im having a file which contains data in the below format.

<data1/><data2/><data3/>.........<dataN/>

How can i convert the data into the below format

<data1/>
<data2/>
<data3/>
.........
<dataN/>

Upvotes: 0

Views: 161

Answers (1)

anubhava
anubhava

Reputation: 785108

Using grep -o you can do:

grep -o '<[^>]*>' file
<data1/>
<data2/>
<data3/>
<dataN/>

Upvotes: 1

Related Questions