Please help me with the following shell script
Hello,
I'm not too good with shell scripts yet, and having a hard time with the following task: I need to write a script that separates even and odd lines in a file and then writes them in two different files. Any help is apriciated, thanks in advance. |
A quick google search of...
bash separate odd and even lines the first hit being this webpage... http://bash.cyberciti.biz/academic/w...ven-line-file/ Which is one method |
This certainly sounds like homework....
Tell us more about why you need to do this, and show what you have tried. One tool to look into is SED---it has the ability to take action based on line #. Really good tutorial here: http://www.grymoire.com/Unix/Sed.html |
Did you try using SED. Google for it and you will find tons of ways in which you can use it to achieve what you want.
:) Linux Archive |
All times are GMT -5. The time now is 04:39 PM. |