Hell everyone. I am trying to parse a text file and remove all newline characters(\n) that are located within quotes. My data looks like this:
"id12345"<tab>"Fix code in sections:\n 1.2.7\n 1.2.8" \n
"id12346"<tab>"Fix code in sections:\n 1.2..5.4\n 1.2.3.2" \n
"id12347"<tab>"Fix code in sections:\n 1.g.8\n 1.y.r" \n
I don't want to remove the \n characters at the end of the record, I just want to remove all \n characters that are located inside the quotes. I thought I could just remove all \n characters and then put them back at the end of each record by doing this:
first command = s/\n/ /g;
second command = s/"id1/\n"id1/g;
But this method is ugly and depends on a match of the beginning of the record number. Isn't their a cleaner way to do it????????????????
Sorry guys but I'm really new to perl.
thanks,
Matt
"id12345"<tab>"Fix code in sections:\n 1.2.7\n 1.2.8" \n
"id12346"<tab>"Fix code in sections:\n 1.2..5.4\n 1.2.3.2" \n
"id12347"<tab>"Fix code in sections:\n 1.g.8\n 1.y.r" \n
I don't want to remove the \n characters at the end of the record, I just want to remove all \n characters that are located inside the quotes. I thought I could just remove all \n characters and then put them back at the end of each record by doing this:
first command = s/\n/ /g;
second command = s/"id1/\n"id1/g;
But this method is ugly and depends on a match of the beginning of the record number. Isn't their a cleaner way to do it????????????????
Sorry guys but I'm really new to perl.
thanks,
Matt