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