The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: alternate lines
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 03-17-2008
pstanand pstanand is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 10
alternate lines

Hi,
I'm new to Unix. I want to read the all the lines from a text file and write the alternate lines into another file. Please give me a shell script solution.

file1
-----
one
two
three
four
five
six
seven

newfile(it should contain the alternate lines from the file1)
-------
one
three
five
seven

please let me know a solution

Thanks in advance
Pstanand