Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Split file based on delimiter 1

Status
Not open for further replies.

stu78

Programmer
May 29, 2002
121
GB
Hi,

I have some data to split; the delimiter will always be !

so I just need to format e.g.

test1!test2!test3!

into
test1!
test2!
test3!

 
A starting point:
Code:
awk '{x=$0;gsub(/!/,"!\n",x);printf "%s",x}' /path/to/input >output

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top