How to use REPLACE when Excel data has [LF] rather [SPACE].

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use REPLACE when Excel data has [LF] rather [SPACE].

Art Kendall
Thought this might be a help to others who read in data from Excel.

When an variable that is read in from Excel contains a LF rather than a SPACE,

string LineFeed(a1).
compute Linefeed = string(10,PIB1).
compute Address = replace(Address,LineFeed," ").

Seems to fix it.  This seems to occur when the excel cell had several lines.
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: How to use REPLACE when Excel data has [LF] rather [SPACE].

Art Kendall
The presence of linefeed seems to also occur intermittently as the second padding character at the end of a string when the data comes from a .xlsx file.

For now I just put the replace function in a do repeat across all string variables from .xls or .xlsx sources.



Art Kendall
Social Research Consultants