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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help adding newline

Status
Not open for further replies.

SP68

IS-IT--Management
May 22, 2005
18
0
0
US

All,

I need help adding newline using awk and this is what I have for the input file:

DN: user1,ou=testing,o=abc
Changetype: modify
l: loca

DN: user2,ou=testing,o=abc
Changetype: modify
l" locb

I ran this command and it did not work.
awk '{print}/^Changetype:/{print "Delete: l"' /path/to/input > output

Please advice,

SP

 
awk '{print}/^Changetype:/{print "Delete: l"[highlight]}[/highlight]' /path/to/input > output

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks, it worked but it print everything on the same line.
I would like the output looks like this:

DN: user1,ou=testing,o=abc
Changetype: modify
Delete: l
l: loca

DN: user2,ou=testing,o=abc
Changetype: modify
Delete: l
l" locb


Thx,

Steve
 
it print everything on the same line
??? works for me.
 

Yes, it works but everything is printed it on the same line, which I don 't want it to be. I tried replace the print with printf /n and it did not work.

Please advise

SP
 
Are you writing and reading your file on the same computer ?

--------------------

Denis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top