I want to print lines that contains date in the string , i am using split module to achieve that task. below code is always printing else statement. 

ctrl.js

```
fs.readFile(dir + '/' + logFile, 'utf8', function(err, data) {
        var lines = data.split('\n');
        var linesWithDate = lines.split('|')[0].replace(/[\[\]']+/g,'');
        lines.forEach(function(line) {
            if (linesWithDate) {
                console.log('print lines with date',line);
             } else {
                console.log('print lines without date',line);
             }
        }
    });

```

file data 

```
[2017-03-23T18:13:16Z]|zlpv7490|verbose|bmid: n/a|infra.topicWorkers|topology changed, emitting topology event lorem ipsum
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy 
[2017-03-23T19:20:16Z]|zlpv7490|verbose|bmid: n/a|infra.topicWorkers|topology changed, emitting topology event lorem ipsum

```