Question: I need to remove empty new lines from text file in terminal.

Example file

```
123
123
123
123

123

123

```

I've searched in google a bit but only solution found was `sed '/^$/d' myFile > tt` and it does not help. I still got these empty new lines.

Answer: 
**Using AWK:** NF is AWK's in-built variable that stores the number of fields in each record. When used by it self, it will print only those lines where NF!=0. 

```
[jaypal~/Temp]$ cat t
123
123
123
123

123

123

[jaypal~/Temp]$ awk 'NF' t
123
123
123
123
123
123

```
Here's another solution:

```
python -c "import sys; print ''.join(line for line in sys.stdin.readlines() if line.strip() != ''),"

```

(`python` is installed by default)