punchykool
MIS
I have what appears to be a user error, but I cannot determine why the results are not coming out right.
I have a file with 90 validated lines in it.
//I counted them manually
Using `wc -l`, it yields 89.
I look for lines with the string "A" in it and get 79.
//The prompt returns on a newline
I look for lines with the string "B" in it and get 8.
//The prompt returns on a newline
I look for lines with the string "C" in it and get 2.
//Here the prompt does not return on a newline
In reality, there are really 3 lines with "C" in it.
The resulting sets equal the total, so that matches up, but still the missing "C" record is not returned nor included in the total count?
I have converted the file using dos2unix to remove the newline chars. I even viewed the hidden chars in the file using vi and the ':set list' modal, but I do not see anything but the dollar sign at the end of each line. There are no blank lines in the file either nor any stray characters out of view. Dumping the file to the screen with `cat`, I see that on the last record, it does not get a newline on the screen, so the prompt is placed at the end of this record? I am seeing this behavior in several other similar files with similar origins.
I am using SunOS 5.6.
Any help, suggestions appreciated. I have seen this happen over the years and had no time to investigate. I simply had to do the math longhand in the files :-|
I have a file with 90 validated lines in it.
//I counted them manually
Using `wc -l`, it yields 89.
I look for lines with the string "A" in it and get 79.
//The prompt returns on a newline
I look for lines with the string "B" in it and get 8.
//The prompt returns on a newline
I look for lines with the string "C" in it and get 2.
//Here the prompt does not return on a newline
In reality, there are really 3 lines with "C" in it.
The resulting sets equal the total, so that matches up, but still the missing "C" record is not returned nor included in the total count?
I have converted the file using dos2unix to remove the newline chars. I even viewed the hidden chars in the file using vi and the ':set list' modal, but I do not see anything but the dollar sign at the end of each line. There are no blank lines in the file either nor any stray characters out of view. Dumping the file to the screen with `cat`, I see that on the last record, it does not get a newline on the screen, so the prompt is placed at the end of this record? I am seeing this behavior in several other similar files with similar origins.
I am using SunOS 5.6.
Any help, suggestions appreciated. I have seen this happen over the years and had no time to investigate. I simply had to do the math longhand in the files :-|