Write the total number of rows in multiple files into another file

Hello Friends,

I know you all are busy and inteligent too...

I am stuck with one small issue if you can help me then it will be really great.

My problem is I am having some files i.e.

Input.txt1
Input.txt2
Input.txt3

Now my task is I need to check the total number of rows in the above 3 files and then write only the numeric value( total number of rows in that file) into another file.

so for this I have given the below command:

wc -l < Input.txt* > MyFile.txt

But its giving me the below error:

A file or directory in the path name does not exist.
ksh: ISI_SAP_Sourcing*: 0403-016 Cannot find or open the file.

Can anyone please help me.

When you redirect you can only specify one file. Try:

wc -l Input.txt* > MyFile.txt

@ Scrutinizer,

I have tried this but the out I am getting in the MyFile.txt is :

       8 ISI_SAP_Sourcing_20120316_065816.txt
       1 ISI_SAP_Sourcing_20120329_010112.txt
       1 ISI_SAP_Sourcing_20120330_011023.txt
      10 total

But I don't want all these above contents.

See in my all those 3 input files I am having total 10 number of rows.

So in my output file that is MyFile.txt , I need the output as only 10.

I don't need any other information in my output file.

Hope you understood my point.

Try concatenating (cat) first:

cat Input*.txt | wc -l > MyFile.txt

Thanks mate its working......