I have a "|" delimited text dataset. One of the fields is free text from doctor notes, which causes issues when trying to read the data into SAS. There are no quotation marks to mark the start and end of the text field. The field may contain either the delimiter itself (creating a false field) or paragraphs (creating false rows). Here is an example: ID|VAR1|VAR2|VAR3|VAR4 1|1|0|abdebeabe|abc 2|0|0|abdebe|abe|bcd 3|0|1|abedce dfekld|bcd 4|0|1|abdfkdlaj||dklfjsle|ndw 5|1|0|abedce dfekld dafhdj|wer 6|0|0|abdebeabe|lkm In this example, VAR3 contains free text. ID 2 and 4 would create extra fields. ID 3 and 5 would create extra rows. The dataset itself contains thousands of records, so I'd like to have a streamlined process that will correctly read these entries as one record and one field. At this point, I have syntax that would identifying problematic lines by tracking the number of times the delimiter appears in a row, but not how to make corrections without manually doing it by hand. Has any one done that before? Thanks in advance!
... View more