The UNIX and Linux Forums  

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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 03-17-2009
narang.mohit narang.mohit is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 17
convert new line to tab

hey i m newbie i dont know whether this is happining in my terminal or is there any reason behind this
here it is
when i do
1.) sed -n 's/\t/\n/gp' space > enter #where space is tab seperated file
it works fine it give me a outupt that all tab seperated convert into column

but when i tried to reverse this it wount work
2.) sed -n 's/\n/\t/gp' enter > space

it wouldnt give me any output
i know there is an alternative for this
3.) cat enter | tr "\n" "\t"

i only want to know is there any reason behind the 2 case

thanx in advance