Question: I have the below java code in which i am passing a file name to the the calling method lets say below code is initially the code is 

```
File file = new File("C:\\oabc.csv");
String filename = file.getName();
s = getFileExtension(file) ;
if (s.equalsIgnoreCase(".csv"))
{
     convertcsvtoexcel(filename);
}

```

now since there is an csv file that is being passed so it will call the method to convert the csv to excel till that stage i have tried to debug i am getting the filename but below is the convert code that is called in which it not find the filename throwing an exception that file not found exception 

```
 public static  void  convertcsvtoexcel(String filename) throws Exception {
      ArrayList arList=null;
      ArrayList al=null;
      String thisLine; 
      int count=0; 
      FileInputStream file1 = null ;
      file1   = new FileInputStream(new File(filename));

      DataInputStream myInput = new DataInputStream(file1);
      int i=0;

```

But it in the above code it throws the error at line `file1 = new FileInputStream(new File(filename));` saying that it does not found file abc.csv at the specified location

Answer: 
The `:empty` selector is designed to look through the children of an element. This is why it doesn't necessarily work for you in this instance. Instead, you can select by the `value` attribute:

```
$('#sampleDiv input[value=""]').length;

```

[**Example**](https://jsfiddle.net/b5fad3Lu/3/)

Or by `filter()`:

```
$('#sampleDiv input').filter(function() {
    return this.value == '';
}).length;

```

[**Example**](https://jsfiddle.net/b5fad3Lu/4/)
This one works for all input text.
<https://jsfiddle.net/b5fad3Lu/2/>

```
var pl = $('input:text[value=""]').length;
$('#numberofEmpty').text( pl );

```