I have the following file, input.txt
= TITLE =
{{{
Leave Alone
}}}
{{{
Change Me First
}}}
{{{
Change Me second
}}}
And Python Code
obj = file("input.txt")
for i in obj:
i = i.replace("\n", "")
if i == "{{{":
print i
else:
pass
The problem is if I copy and paste the text into Windows Notepad, upload the file to a linux server and run the script, nothing happens. If I copy and paste the text right into Vi on the server and save input.txt, it works as expected.
I know Windows and *nix text editors handle newlines differently (Windows files show extra new lines on Linux and Linux Files all show up as one line on Windows notepad), could this be part of the problem?