Need a carriage return at end of each line

Hi All,
I am reading two files and writing out the file name and count of lines in each file to an output file.

My script looks like this:

echo "input_file1.out;`wc -l < input_file1.out | sed 's/^[[:space:]]*\(.*\)[[:space:]]$/\1/'` " > comp_file1.out
echo "input_file2.out;`wc -l < input_file2.out | sed 's/^[[:space:]]*\(.*\)[[:space:]]
$/\1/'` " >> comp_file1.out

I have another file sent by user which has carriage return (^M) at end. So I have to compare the output of my file to user file.

user file looks like this:
input_file1.out;100^M
input_file2.out;200^M

and my output file looks like this:
input_file1.out;100CTRL_CHAR

input_file2.out;200CTRL_CHAR

So what is another way to count the number of lines and display the output as??

input_file1.out;100^M
input_file2.out;200^M

Thanks

tr -d '\r' < windows.txt > usable.txt

voila, no more carriage returns.

---------- Post updated at 04:59 PM ---------- Previous update was at 04:55 PM ----------

Also, you can make your line counting script much simpler.

echo "${FILENAME};$(wc -l < ${FILENAME})"

[edit] scratch my second solution, it adds a silly 'total' line to the end.

I think that would work.

Thanks a lot.