![]() |
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 |
| Script that extract some lines from a file lookin into another | heartwork | Shell Programming and Scripting | 7 | 01-25-2008 06:57 AM |
| How to extract a sequence of n lines from a file | 0ktalmagik | Shell Programming and Scripting | 4 | 06-29-2006 11:24 PM |
| How to extract many lines from a file, typically the 1000 last | kingkong | UNIX for Dummies Questions & Answers | 3 | 11-23-2005 04:20 AM |
| how to extract a range of lines from a file | beilstwh | Shell Programming and Scripting | 5 | 07-09-2004 08:20 AM |
| extract specific lines from file | apalex | UNIX for Dummies Questions & Answers | 2 | 05-15-2001 09:57 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
hello, hope you can help me:
ive got a file called archivos The content or structure of this file is ./chu0/filechu ./chu1/filechu I extract each line from this file manually and redirect to a file, and it Works fine, so the command line is: awk ‘/chu0/ {print $0}’ < archivos > portal0 awk ‘/chu1/ {print $0}’ < archivos > portal1 The problem is to extract these lines automatically, an i dont know how to do this, with a loop for example. and i tried but gets some error whit this command i=0 while (i<=num) do awk –v i=$i ‘ /chu$i/ {print $0} < archivos > portal$i done how can i do that so i can extract lines from this file automatically?can you help me? please. |
|
||||
|
This code lnly print the output on the screen:
line-> [./chu0/filechu] line-> [./chu1/filechu] But, i want is to redirect the content of each line to a file i.e. file0 the content must be ./chu0/filechu and file1 the content must be ./chu1/filechu thanks |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|