BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AdamR
Fluorite | Level 6

Hello,

We're having issues removing tabs from our data as after the data massage the export into an Excel file is Unreadable and it's mostly caused by users entering a tab character in the software.

 

We've tried the following and others without any success:

 

PROJECT_NOTES=compress(PROJECT_NOTES,' ',s);

 

In the quotes is a tab. Removing the tab or replacing it with a space is OK.

Thoughts?

 

Adam

SAS 9.3

1 ACCEPTED SOLUTION

Accepted Solutions
SuryaKiran
Meteorite | Level 14

You can also use TRANWRD() function to replace tab with a space tranwrd(string,'09'x,' ')

Thanks,
Suryakiran

View solution in original post

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

To remove tabs I would say:

project_notes=compress(project_notes,'09'x);
FreelanceReinh
Jade | Level 19

@AdamR wrote:

We've tried the following and others without any success:

 

PROJECT_NOTES=compress(PROJECT_NOTES,' ',s);

 

In the quotes is a tab. Removing the tab or replacing it with a space is OK.

 


 

Hello @AdamR,

 

The modifier in the third argument of COMPRESS must be a character expression, i.e. 's' (unless s is a character variable containing the string 's' or 'S' etc.). With this correction the COMPRESS function should remove tabs ('09'x) and a few other "space characters" regardless what's in the quotes in the second argument.

SuryaKiran
Meteorite | Level 14

You can also use TRANWRD() function to replace tab with a space tranwrd(string,'09'x,' ')

Thanks,
Suryakiran