Thank You.
Is it possible to read one more item fro the text file..
currently i am using empno, name, sal.
along with this, i need to add two more parameter (relieve date,EmpDesignation,No.ofPrjhandled).
I thing below line is reading particular text from the text fille.
line = my_file.split('\n')[6]
if i want another parameter in another line how do we specify..?
def parse_line(line):
for item in ['Emp No', 'Name', 'SAL']:
line = line.replace(item, '')
return [item.strip() for item in line.split(':') if item.strip()]
my_file = """Please find below emp details,
EMP DETAILS
________________________________
Emp No: 101 Name:RASUL K SAL: 30000
________________________________
Join Date: 10 JAN 2010 From Native: First
Releave Date: 25 APR 2018 To Native: Second
EmpDesignation: Manager
No.ofProjects handled: 10
"""
line = my_file.split('\n')[6]
print(parse_line(line))
Is it possible to read one more item fro the text file..
currently i am using empno, name, sal.
along with this, i need to add two more parameter (relieve date,EmpDesignation,No.ofPrjhandled).
I thing below line is reading particular text from the text fille.
def parse_line(line):
for item in ['Emp No', 'Name', 'SAL']:
line = line.replace(item, '')
return [item.strip() for item in line.split(':') if item.strip()]
my_file = """Please find below emp details,
EMP DETAILS
________________________________
Emp No: 101 Name:RASUL K SAL: 30000
________________________________
Join Date: 10 JAN 2010 From Native: First
Releave Date: 25 APR 2018 To Native: Second
EmpDesignation: Manager
No.ofProjects handled: 10
"""
line = my_file.split('\n')[6]
print(parse_line(line))