![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ksh scripting help | praveenbvarrier | Shell Programming and Scripting | 1 | 04-15-2008 10:19 AM |
| Scripting Help! | liezer | Shell Programming and Scripting | 7 | 09-15-2006 03:52 AM |
| difference between AIX shell scripting and Unix shell scripting. | haroonec | Shell Programming and Scripting | 2 | 04-12-2006 08:12 AM |
| scripting guru's pls help me with scripting on AIX | thatiprashant | Shell Programming and Scripting | 1 | 01-20-2006 07:58 PM |
| HELP! Need HELP scripting! | adawg1283 | Shell Programming and Scripting | 7 | 09-29-2004 03:48 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Thanks Franklin52, the code you gave works just fine, except there is one problem. I want it to make a new paragraph when tab is used as well.
So if the input file is: Code:
First line of the second paragraph.
Second line of the second paragraph.
Third as well.
Code:
First line of the second paragraph. Second line of the second paragraph.
Third as well.
Thanks in advance! Last edited by Muki101; 12-01-2008 at 06:59 AM.. |
|
||||
|
You can left the awk code unaltered. Translate the tabs to newlines with tr and pipe the output to the awk command:
Code:
tr '\t' '\n' < file | awk 'BEGIN {RS=ORS="\n\n"} $1=$1'
Code:
$ cat file
The first line.
Second line.
First line of the second paragraph.
Second line of the second paragraph.
Third as well.
$
$ tr '\t' '\n' < file | awk 'BEGIN {RS=ORS="\n\n"} $1=$1'
The first line. Second line.
First line of the second paragraph. Second line of the second paragraph.
Third as well
|
![]() |
| Bookmarks |
| Tags |
| sed delete line |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|