Reading data from txt file where delimiter is © (copyright symbol)

Reply
Learner
Posts: 1

Reading data from txt file where delimiter is © (copyright symbol)

I am trying to Read data from txt file where delimiter is © (copyright symbol).
The data fields in txt file have varied lengths. Any help with this would be highly appreciated.

Thankshelp_Sas.PNG

Super User
Super User
Posts: 7,932

Re: Reading data from txt file where delimiter is © (copyright symbol)

The photo you posted does not look like a text file. What type of file are you reading?

data want ;
  infile 'myfile.txt' dsd dlm='©' truncover ;
  length var1 8 varr $20 ;
  input var1 var2 ;
run;

 

Super User
Posts: 9,868

Re: Reading data from txt file where delimiter is © (copyright symbol)

You can use any single-byte character as delimiter in an infile statement. So if it's the character 'a9'x from the ISO 8859-1 set, you can use it. If it's the UTF-8 character, you can't, and you will have to "manually" dissect the _infile_.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 2 replies
  • 135 views
  • 0 likes
  • 3 in conversation