- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have some files which I read in from Excel.
There are some long strings which have carriage returns in the middle. I need to remove the CR but leave the rest of the value intact. Is this possible?
Thanks!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Use the COMPRESS function to remove "0d"x.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I tried the following:
directory3 = compress(directory2, '0d'x);
I did not get an error message but the carriage returns are still there. Did I miss some punctuation or a modifier or something?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Use a HEX format on your character string to see the character in the string.
proc print data=have;
var stringVar;
format stringVar $hex50.; *make sure there's an appropriate length;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I strongly suspect that you want to replace the character with a space. Removing the line feed means the resulting text will be poor for reading.
Example:
This is an Excel value split to two or more lines.
When you remove the line feeds you will get
This is an Excel valuesplit to two or morelines.
The TRANSLATE function will replace a character with another.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Is there any way to change my output program which built the Excel files so that it is only outputting text values and no weird characters?
To output I am just using ods excel and proc printing a data file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Use the FLOW="TABLES" option.