Input file!

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2008
Posts: 4
Reputation: cristi2008 is an unknown quantity at this point 
Solved Threads: 0
cristi2008 cristi2008 is offline Offline
Newbie Poster

Input file!

 
0
  #1
Nov 28th, 2008
hy! How can I do so that my input to be a file.To read a file as input.thanks
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 399
Reputation: eggi will become famous soon enough eggi will become famous soon enough 
Solved Threads: 47
eggi eggi is offline Offline
Posting Whiz

Re: Input file!

 
0
  #2
Nov 28th, 2008
Hey there,

How do you mean? Do you just want to read a file into a program or have the program read a file? Or something else.

Shell Scripting Syntax (Toggle Plain Text)
  1. while read x
  2. do
  3. echo $x
  4. done <input.thanks

If you could clarify, that would be cool.

Thanks,

Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 4
Reputation: cristi2008 is an unknown quantity at this point 
Solved Threads: 0
cristi2008 cristi2008 is offline Offline
Newbie Poster

Re: Input file!

 
0
  #3
Nov 29th, 2008
I want to read a file as input.
I have to do this:
I have to read a file then to take the 2,4,6,8,.... rows and put them in onother file and then the same thing whit 1,3,5,...rows.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 399
Reputation: eggi will become famous soon enough eggi will become famous soon enough 
Solved Threads: 47
eggi eggi is offline Offline
Posting Whiz

Re: Input file!

 
0
  #4
Nov 30th, 2008
You can do this pretty simply with awk. Check these boards for a fairly recent post on (I think the title is roughly) "even and odd" columns. You should find about 6 different ways to do it there, some of which I submitted.

I think you should be all set after that

, mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Shell Scripting Forum


Views: 739 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Shell Scripting
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC