![]() |
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 |
| Cutting specific lines from a file | pathanjalireddy | Shell Programming and Scripting | 15 | 06-04-2009 01:32 AM |
| need help cutting consecutive lines with sed or awk | raghin | Shell Programming and Scripting | 2 | 06-04-2008 04:59 AM |
| Cutting the top two lines, and also charachters below. | jalge2 | UNIX for Dummies Questions & Answers | 5 | 08-02-2005 02:59 PM |
| Cutting n consecutive lines from a file... | Vishnu | UNIX for Dummies Questions & Answers | 2 | 10-18-2002 10:49 AM |
| Cutting lines out using sed I presume. | cfoxwell | UNIX for Dummies Questions & Answers | 5 | 01-08-2002 12:13 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Dear All,
Is there a way to cut the lines that have been "head" Here is what i m trying to do Please advice there is file name dummy.txt now i am trying to head this file 4 time by using a loop and every time this file is head with different values e.g in first instance it will be head -1 for second interval it will be head -20 and so on. these intevaral are random and are been generated by a counter evertime a script is executed counter bounce with a new value and according to that value file will be "head" four times. Now the issue is, during the first interval if file is "head 5" times (i.e. head -5) output must be saved with a new file extension, and when its executed second time for (head -10) file should start from (6th value to 16th value and not from 1st to 10th) and so on. please advice from this point.. ![]() Thankz in advance ![]() |
|
||||
|
Simple way to do it:
Code:
head -10 <file_name> | tail -5 |
|
||||
|
thnkz for the reply.
the values mentioned here are just an example. May be this can help you out.. here it is what i am trying to to For e.g a file name dummy.txt contains value 1-10 coloum wise. now i want to head this file 4 four times but with different interval (random numbers are generating from a counter.. no help needed for this case) like in first instant file is head 2 times (head -2 <filename> [output will be 1 2] now for second time when the file is head let say 4 times (i.e head -4 ) than output should be (3 4 5 6) and not (1 2 3 4). Similarly, for third and fourth time. May be this will help ya understand in a better way. Please help Thankz in advance. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|