Hi Guys, I have a CSV which is pipe delimited.and doesn't include any text identifiers (the individual strings are not surrounded by double inverted commas or anything else for that matter). Unfortunately some of the text strings contain embedded carriage returns that I obviously need to remove in order to read the file in effectively. I have searched the internet high and low for a solution and attempted to use what I have located without success. The solution with the most potential seemed to be a datastep with both infile and file statements using the sharebuffers option. For some unexplained reason this method simply kills my E.G session (which I know sounds crazy, but that is what happens). The following code is a reasonable representation (although an over simplification) of what how the data would look if I imported the CSV file. DATA STUFF; LENGTH TEXT $1000; INPUT TEXT $; DATALINES; VAR1|VAR2|VAR3|VAR4|VAR5|VAR6|VAR7|VAR8|VAR9|VAR10|VAR11|VAR12 1|2|3|4 |5|6|7|8| 9|10|11|12 ; RUN; To get around this I thought that I could read the first line of the text file (containing the variable names which never have embedded carriage returns) into a single variable and identify the number of pipes (11). I would then do the same for the remainder of the file and where the number of pipes are less than 11 then append the next record (by lagging the first occurance) to the second occurance and then delete any records that don't have 11 pipes. This works perfectly until you come across an instance where there are multiple carriage returns for a single record. Can anyone offer a suggestion on how I could continue this process until the number of pipes equals 11? I am open to other solutions, but this is the best I could come up with. Any help would be greatly appreciated. Regards, Scott
... View more