![]() |
|
|
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 |
| Script to add a single line to middle of text file. | progkcp | Shell Programming and Scripting | 2 | 05-12-2008 03:44 PM |
| Question about 'sed' | heartsunny2000 | Shell Programming and Scripting | 4 | 02-21-2008 06:10 PM |
| How to insert text into first line of the file and middle of the file? | ali hussain | Shell Programming and Scripting | 3 | 03-05-2007 05:54 AM |
| Number a list at end of line using 'sed' | chassis | Shell Programming and Scripting | 5 | 09-13-2006 03:38 PM |
| awk insert character in the middle of a line | mmarino | Shell Programming and Scripting | 3 | 11-18-2005 12:00 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
|||||
|
sed2liners Code:
# print line number 52 sed -n '52p' # method 1 sed '52!d' # method 2 sed '52q;d' # method 3, efficient on large files |
|
||||
|
echo `wc -l filename| cut -f 1 -d " "`/2 | bc
syntax error on line 1, teletype Thanks for the replies, but I can't get it to work. The file is a list of names: Frank Sally Sam Julie Joe Jay Ralph John Sally Fred Sue word count(lines) is 11 I need to print the middle line which is 'Jay' which is the middle (6th) line. thx. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|