@@ -0,0 +1,1434 @@
+#Had a text file (sample alumini.txt) and need to extract the information name,image, and email. %0A#Use form to replace name,image and email%0A%0Aimport re%0Afrom string import Template%0A%0Afile = open('alumini.txt').read()%0Asplit_file = file.split('%7D')%0A%0Aprint(split_file)%0A#remove white spaces%0Adef remove_whitespace(string):%0A    string = string.strip()%0A    return string%0A%0A# convert list to strings%0Adef convert_list_string(list_value):%0A    string_value = ''.join(list_value)%0A    return string_value%0A%0Aform ='''%0A         %3Cdiv class=%22media%22%3E%0A           %3Cdiv class=%22media-left%22%3E%0A            %3Ca href=%22#%22%3E%0A            %3Cimg class=%22media-object%22 src=%22../images/$image%22 alt=%22Simon%22 width=%22200px%22%3E%0A            %3C/a%3E%0A            %3C/div%3E%0A           %3Cdiv class=%22media-body%22%3E%0A           %3Ch4 class=%22media-heading%22%3E$name%3C/h4%3E%0A           %3Ca href=%22mailto:Email%22%3E$mail%3C/a%3E%0A           %3C/div%3E%0A           %3C/div%3E%0A           %3Cbr/%0A         '''%0A%0A%0Afor value in split_file:%0A    list_info = %5B%5D%0A%0A    email = re.findall(r'Email:%7C%5Cs:(.*)%5C%3Cbr%3E', value)%0A    image = re.findall(r'Image:(.*)%5C%7C', value)%0A    name = re.findall(r'%5C'%5C'%5C'%5C*(.*)%5C%3Cbr%3E', value)%0A%0A    email = convert_list_string(email)%0A    image = convert_list_string(image)%0A    name = convert_list_string(name)%0A%0A    email = remove_whitespace(email)%0A    image = remove_whitespace(image)%0A    name = remove_whitespace(name)%0A%0A    info = Template(form)%0A    info = info.substitute(image=image,name=name,mail=email)%0A    print(info)%0A

Create alumini.py