f



Converting A Unicode Text File to An ASCII Text File

We have a large number of text files built in Unicode that we need to
be read by SAS. SAS does not read Unicode text. To convert the Unicode
text to ASCII text we did the following:
A Unicode text file adds an additional blank space to each character.
To remove this blank character, you can use the code below.

The hexidecimal value '00' is a blank character. So remove it using
the SAS statement '00'x. The 'x' tells SAS you are reading
hexidecimal.

Use RECFM=N to tell SAS that you are reading a stream of data that
will not conform to a typical file structure. SAS will treat the file
as a very long single record.

data _null_;
 infile 'c:\xmlfile.xml' recfm=n;
 file 'c:\ascifile.txt' recfm=n;
 input c $1.;
 if c ne '00'x then put c $1.;
run;
0
4/25/2008 3:00:56 PM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
1157 Views

Similar Articles

[PageSpeed] 24

Reply:

Similar Artilces:

Re: Converting A Unicode Text File to An ASCII Text File
Mike, SAS does not read Unicode text. It is not true encoding=utf8 exist HTH Andre I tried upon this contents (a french one saved in utf8) but showed here in windows Nom,Adressé "Bob","cité Bergère" "Ann","impasse Dôme" with this code under sas windows options validvarname=any; filename a "z:\utf8.csv" encoding=utf8; PROC IMPORT OUT= WORK.PAPER3 DATAFILE=a DBMS=CSV REPLACE; GETNAMES=YES; DATAROW=2; RUN; the results are Nom Adress� Bob cit� Berg�re Ann impasse D�me But perhaps you have another problem...

convert mat files (struct) to ascii text files / save data as ascii text
I'm using a script that saves data (x,y) as .mat files in struct format. However I need it to save the data as ascii text files. How can this be done? I've tried save -ascii etc etc but matlab returns that the data format is not suitable to save as ascii. So is there a (simple) way to either save my data as ascii text or convert a generated .mat file to ascii text file (CSV or else)? Thanks! On Dec 23, 10:43=A0am, "Stijn Oonk" <stijn.o...@tno.nl> wrote: > I'm using a script that saves data (x,y) as .mat files in struct format. = However I need it to sav...

Read a non text file
How can i convert a weird looking file to text file. I know the main info is stored in the file which looks like below. "����<t���Jч�ĉTV��y�rr��Ph"e~Wm>�E�0Y'p�=C�&�rؙ�<t�Fx�Zo$�+T��=���H Or�r6�S��m&7<�p�q��� u����w}�jlꥎ+_�����Z�?��v��ȉ�XC R�}�_�׍�:�$)�o}��NʨW\&���I@b�#T�B��8���J��CL�ypr\�]R���p\��S�XRҏ�f&?/��� 2�t�_��x���bG���Z�D�v�s [�"��N�# Ѡ�@)�����h'&%�(�)��c�ͼA ���zUZjLRyu�P̤� ��� �W��e�@1'�(��u-nG��p��2_�� T&�6+� _� d�(1Z�E@���h�F�z �~x�fG���s�b�/-+�@��0�%��6�wu�=��z���Y�0...

Command for converting text file (Windows CR) to text file (Linux) ?
Assume I trasferred/uploaded a text file (which was created on a Win system) to Linux system. How can I convert the eol chars to the Linux style ? I opened (and later saved) it in vi editor. But this didn't help. What else can I do to convert it? Karl In article <475ef469$0$17522$9b4e6d93@newsspool4.arcor-online.net>, Karl Medrell <k.medrell@hotmail.com> wrote: >Assume I trasferred/uploaded a text file (which was created on a Win >system) to Linux system. > >How can I convert the eol chars to the Linux style ? > >I opened (and later saved) it in vi editor...

converting .wav files (with some header text) in to ascii files
Hi , I have absorbance spectra data files which are in wave format. they have a header text to about 8 lines. After that the absorbance data at different wavelengths are listed. I am trying to convert this file in to a matlab file so that I can make further modifications to it. I tried using the wavread command but it keeps giving me error saying that it is not a wave file. I would appreciate any help on this. Thanks Madhavan Madhavan Narayanan wrote: > Hi , > I have absorbance spectra data files which are in wave format. they > have a header text to about 8 lines. > After that ...

Help needed to convert text file to SAS file
Dear all, I need help to convert the following text file to SAS file. There are two parts for each line which is divided by �:�, the part before �:� will be the variable name and the part after �:� will be the value for the corresponding variable in the final SAS file. (Actually, there is only one line for HealthCoachNotes and Notes respectively in the text file). I want to ignore the second to fourth line, convert the first line, skip over the second to fourth line, and continue to convert the fifth till the end. Does anybody have any idea how to do it? Any input would highly appreciate. ...

Reading Text File, Text Scrolling and erase line from a text file
Hi , How can I Reading Text File, then Text Scrolling by means of keys "page UP" "page Down" and erase a specific line from a text file , when press "F2" key? Best Regards, Lidia from Poland -- ========================================= Pozdrawiam Lidiaa Lidiaa schrieb: > Hi , > > How can I Reading Text File, then Text Scrolling by means of > keys "page UP" "page Down" and erase a specific line from a text > file , when press "F2" key? > > ...

Re: Help needed to convert text file to SAS file
Hi, I'm not sure what all converting or parsing you want to do but here is a method of fetching the parts and pieces. If you need more help, hollar again... * read flat file varying length ; data thedata(drop=pline); length pline $2000 name_part $100 value_part $1000; infile 'c:\temp\myfile.txt' length=lenvar; input @1 pline $varying. lenvar; if pline eq '' then delete; name_part = trim(left(scan(pline,1,':'))); value_part = trim(left(scan(pline,2,':'))); run; Hope this is helpful. Mark Terjeson Senior Programmer ...

Re: Help needed to convert text file to SAS file #3
Thanks for answering my question, that has been solved. Thanks! Nancy "Terjeson, Mark (IM&R)" <Mterjeson@russell.com> wrote: Hi, I'm not sure what all converting or parsing you want to do but here is a method of fetching the parts and pieces. If you need more help, hollar again... * read flat file varying length ; data thedata(drop=pline); length pline $2000 name_part $100 value_part $1000; infile 'c:\temp\myfile.txt' length=lenvar; input @1 pline $varying. lenvar; if pline eq '' then delete; name_part = trim(left(scan(pline,1,':'))); value...

Re: Help needed to convert text file to SAS file #2
My 2p: data i; retain name_part value_part; infile 'c:\temp\sas.txt' dlm = "|}|" /*JUNK DELIMETER.*/ dsd missover lrecl = 440; informat text $440. value_part $422. name_part $28.; input text; if 2 < _N_ < 9 then delete; if text ^ = ""; if text =:"Notes: Spoke with" then text = tranwrd(text,"re:Patient","re.Patient"); name_part = trim(left(scan(text,1,':'))); value_part = trim(left(scan(text,2,':'))); if text=:"Notes: Spoke" then value_part = trim(left(value_part)) || " " || "thx"; if ...

How to convert a audio file to text file
Hi all ,I want to convert audio speech say"I love you" now I want to write this speech on a text file ? I want answer with reference to speech recognition plz help me. Thanks in Advance. sattu; An alternative is to check the following: <a href="http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3E8B356A4E034080020E74861&p_node=DZ52072&p_submitted=N&p_rank=&p_answer=&p_source=External">Voice Recognition in LabVIEW</a> Regards; Enrique ...

Text file converted to .mat file
I have very new to matlab (it was just installed on my unix machine). I have a text file that looks like this: ABC <tab> 2007.220.76804.144 <tab> 302892231 The first column will be the same for some rows and different for other rows. The second column is a date/time field. The 3rd column is a double field that could hold many decimal places. I need to get this converted to a .mat format. I have been reading the tutorials and doing the examples, but I am still confused. I need to save this as a .mat file programatically because I need to retain the doubles. Is there another format...

Convert DBF file to text file.
I need to convert DBF file to a pipe delmited text file. Can somebody guide me with a sample C program that does this kind of conversion. Thanks, Abhi. abid <abid7575@yahoo.com> spoke thus: > I need to convert DBF file to a pipe delmited text file. Can somebody > guide me with a sample C program that does this kind of conversion. (Unlikely here, but read on...) http://www.csclub.uwaterloo.ca/u/dj3vande/clc/clc-welcome.txt http://www.eskimo.com/~scs/C-faq/top.html http://benpfaff.org/writings/clc/off-topic.html -- Christopher Benson-Manica | I *should* know what I'm talk...

How to convert text file to fits file
Hi, I am having text file with two columns one is wavelength and intensity, I need to convert this to fits file, please help me out in this regard regards sid On Apr 22, 7:21=A0am, sid <gunvicsi...@gmail.com> wrote: > Hi, > =A0 =A0 I am having text file with two columns one is wavelength and > intensity, I need to convert this to fits file, please help me out in > this regard > regards A general outline. First, get the IDL Astronomy Library if you don't already have it. Next, read your data into IDL variables. It's pretty easy to do somet...