Member Avatar for cristi2008

hy! How can I do so that my input to be a file.To read a file as input.thanks

Recommended Answers

All 3 Replies

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.

while read x
   echo $x
done <input.thanks

If you could clarify, that would be cool.



Member Avatar for cristi2008

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.