5 of 5
deleted 1689 characters in body; edited title

How do i remove "\n" from an entry within a list?

I've edited the original question as it was no longer relevant, so here is the new request:

I have a text file that contains this:

Sender,Date,Subject
SolarAlert <[email protected]>,2019-01-11,SolarAlert Alert: DATAALRT
SolarAlert <[email protected]>,2019-01-11,SolarAlert Alert: NETALRT
SolarAlert <[email protected]>,2019-01-11,SolarAlert Alert: SFOALRT

Using the following, i'm able to reference the text i require (DATAALRT, NETALRT, SFOALRT).

OPENDOC = open('Alert.txt', 'r')
READDOC = OPENDOC
for line in READDOC:
    rows = [line.split(': ', 2)[-1] for line in READDOC]
newrow = rows

print(rows)
print(rows[1])

But each row also includes a "\n". How would i remove that?

Many Thanks,