I'm trying to figure out how to process an input file and print it out without any whitespace present in the output.
My current script looks like this:
#!/usr/bin/python
kf = open ('keyword.txt', 'r')
sl = open ('syslog.txt', 'r')
for line in kf:
line.replace('\n', "")
line.strip()
print line
The output of this however looks like this:
polkitd
anacron
acpid
rt-kit daemon
goa
AptDaemon
AptDaemon.PackageKit
AptDaemon.Worker
python
Does anyone know how to remove the lines of whitespace between each item?