|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Join multiple lines
Hi
I have a source file ( written i C ) where a funtion call is spread over multiple lines, for example : func( a, b, c ); I want this to be joined into one single line : func(a,b,c); How can this be done with awk and sed ? Regards. Hench |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Maybe you can try something like this: Code:
awk '/);/{c=0} /func\(/{c=1} c{printf $0;next}1' file > newfile |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Thanks Franklin52 !
It works fine. |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to use the the join command to join multiple files by a common column | evelibertine | UNIX for Dummies Questions & Answers | 5 | 07-05-2012 04:15 PM |
| How to use SED to join multiple lines? | DrivesMeCrazy | Shell Programming and Scripting | 12 | 12-21-2009 11:24 AM |
| Join 2 files with multiple columns: awk/grep/join? | InfoSeeker | UNIX for Dummies Questions & Answers | 3 | 12-01-2009 07:45 PM |
| join on a file with multiple lines, fields | crimper | Shell Programming and Scripting | 5 | 12-15-2008 03:50 AM |
| Awk Join multiple lines | hitmansilentass | Shell Programming and Scripting | 5 | 10-27-2006 11:04 AM |
|
|