f



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

Bachenot a �crit :
> 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;
>
>

--
   Andr� WIELKI
   INED (Institut National d'Etudes D�mographiques)
   Service Informatique
   133 Boulevard Davout      75980 Paris Cedex 20
   m�l : wielki@ined.fr      t�l :  33 (0) 1 56 06 21 54
0
wielki (636)
4/25/2008 4:16:18 PM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
799 Views

Similar Articles

[PageSpeed] 58

Reply:

Similar Artilces:

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; ...

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 ...

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...

how to convert .mat file to text file
dear friends, i have a pulse sequence stored as 'waveform' in matlab. how can i cobnvert this into text file? so that i can upload this into AFG. thanks. waiting for help, "salman " <salmanabdullah9@gmail.com> wrote in message <jofkur$rcm$1@newscl01ah.mathworks.com>... > dear friends, > > i have a pulse sequence stored as 'waveform' in matlab. how can i cobnvert this into text file? so that i can upload this into AFG. help save % ascii option help csvread help fprintf % Bruno Thanks Bruno. But i couldnt follow much. my problem is to "convert a file which is a pulse sequence, saved as a .mat file. now this file has to be converted to text file. i thought it had to be done using fopen('filename.mat','wt+'), but this one is also not working fine." can you please again elaborate more simply? i m not much of expert in matlab. thanks for help "Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <joft17$s6k$1@newscl01ah.mathworks.com>... > "salman " <salmanabdullah9@gmail.com> wrote in message <jofkur$rcm$1@newscl01ah.mathworks.com>... > > dear friends, > > > > i have a pulse sequence stored as 'waveform' in matlab. how can i cobnvert this into text file? so that i can upload this into AFG. > > help save % ascii option > help csvread > help fprintf > > % Bruno i inserted this code wave=1*[...

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...

converting XML files to text files
Hello, I have written a tool to convert XML files to an from text files using a COBOL copybook as reference. If you are interested, look at : http://txt2xml-rexx.sourceforge.net/ Comments are welcome. Hope this helps Delaunoy P. ...

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...

concatenating multiple text files into one text file
Hello all, I have a huge number of text files like : spectrum1_300_315.csv spectrum1_315_331.csv spectrum1_331_364.csv spectrum1_364_386.csv spectrum1_386_401.csv ...................................... ....................................... each file contains some headerlines at the beginning and data in 2 columns. I want to concatenate the data of the files into one text file .Can anyone hel me pls?thank u in advance. ...

Plain text file to xml file convert
Hi All, I'm new to xml. and In one of my application i want to convert the text file into xml file for further processing. So, if anyone Know how to do it plz tell me any solution. On Feb 17, 3:25 pm, "mahesh" <mahesh2...@gmail.com> wrote: ... > I'm new to xml. This is 'Java', in case you are confused. >..and In one of my application i want to convert the > text file into xml file for further processing. Oh.. using Java? > So, if anyone Know how to do it plz tell me any solution. Beyond putting the entire text into a CDATA section, I do not s...

convert text file to binary excel file
is there any method / tools good to convert text file (eg. .csv / ..prn) to excel file on the shell ? I try some perl modules , it seems OK , except this tools , could suggest other methods ? thx in advance. On 22 Nov 2004 22:18:09 -0800, a posting issued forth from mia456789@yahoo.com.hk... > is there any method / tools good to convert text file (eg. .csv / > .prn) to excel file on the shell ? I try some perl modules , it seems > OK , except this tools , could suggest other methods ? thx in advance. Depends on what you need... Simply renaming the file to *.xls will make excel think...

Re: How to convert SAS file to .v5x file?
Miranda - What application is a .v5x file? Are saying a SAS v5.18 file? Paul Choate DDS Data Extraction (916) 654-2160 -----Original Message----- From: miranda [mailto:mixiao@UCLA.EDU] Sent: Friday, January 23, 2004 3:05 PM To: SAS-L@LISTSERV.UGA.EDU Subject: How to convert SAS file to .v5x file? Hi , Does anyone know how to alter SAS 8.2 data files to .v5x files? Thanks. ...

Trouble with viewable ascii text in text files...
Trying to input ascii codes such as A..B..C..etc into a file Then read that file and shift each Ascii char by a multiple like *2 or *3...Then take the new string and output to yet another file as my encoded/encrypted file. Then reading that file and converting back to the original string. Problem is many ascii chars are unreadable in a text file and simple truncate to ???????? making it impossible to reverse the numbers or text. Should I be using some kind of encoding of the ascii before outputing to the 1st file? If so, could one of you explain how to encode ascii to ___? and a way to reverse the process Back To ASCII in a file? I'm lost....thanks Robert Blass wrote: > Problem is many ascii chars are unreadable in a text file and simple > truncate to ???????? making it impossible to reverse the numbers or > text. Nope, that doesn't happen. Your program has an error. Either you're talking about the 2nd file, because if you multiply ASCII by an integer you'll surely get something unreadable back, or you've just plain messed up. If you're trying to read the second file, then use bytes (or ints) so you can read binary. Please post an SSCCE that shows the problem. On Wed, 01 Oct 2008 11:52:26 -0400, Robert Blass <blame@messenger.xcx> wrote, quoted or indirectly quoted someone who said : >rying to input ascii codes such as A..B..C..etc into a file >Then read that file and shift each Ascii char by a multiple like *2...

How to write unicode text from RTF to a text file
I'm posting again a question I have asked previously in a more simple way.. We are using RTF control (memo field in a DBF) to store some unicode description in more than 2 languages (this is for a real estate app that describes a property in more than 2 languages). In order to interface with a site, we need to just create a unicode text (xml) adding some unicode string extracted from this RTF control. So far we didnt manage to achieve this as all txt created with VO is ANSI (of cource..) Can anybody suggest a VO solution to this, or do you think this is impossible? Thanks a...

Append image file to ASCII text file
I'm looking for a way on the Linux command line be be able to append an image file to an ASCII text file. One thought I had was to first convert the text file into postscript and then append the signature image to that file. # Convert ascii file to postscript enscript file.txt --no-header -o file.ps # Append both image files into one convert -append file.ps image.bmp file_with_image.pdf This sort of worked, but only part of the text file and image are viewable in the new pdf file so I'm looking for a better solution. The text file is a check that will be printed on a HP laser prin...

Re: converting stc file to ascii files
On Tue, 22 May 2007 12:03:03 -0400, Ankur Arora <ankur.arora@NAGARRO.COM> wrote: >I could not get it in forum the first time i send > >Hi All > >I have a dataset in the format .stc which i want to convert. I want to >convert SAS transport file into an Ascii text file >have seen this done for XPORT file types, but not for CPORT file types > > >LIBNAME TRANSPRT XPORT “<Filename & Path>”; > > PROC COPY IN=WORK OUT=TRANSPRT; > > SELECT <Dataset Name>; > > RUN; > > > >Any idea how to do fo...

How to format a text file just like the RFC-text files?
I want to make some document go like these, what tools can help? Any help would be nice, thanks! BLIOGRAPHY ........................................... 34 APPENDIX A. EXAMPLES ............................................... 36 B. SIMPLE FIELD PARSING ................................... 40 C. DIFFERENCES FROM RFC #733 .............................. 41 D. ALPHABETICAL LISTING OF SYNTAX RULES ................... 44 August 13, 1982 - i - RFC #822 ^L Standard for ARPA Internet Text Messages PREFACE By 1977, the Arpanet employed several informal standards for the text messages (mail) sent among its host computers. It was felt necessary to codify these practices and provide for those features that seemed imminent. The result of that effort was Request for Comments (RFC) #733, "Standard for the Format of ARPA Network Text Message", by Crocker, Vittal, Pogran, and Henderson. The specification attempted to avoid major changes in existing software, while permitting several new features. The framework severely constrains document tone and appear- ance and is primarily useful for most intra-organization communi- cations and well-structured inter-organization communication. It also can be used for some types of inter-process commun...

How to convert this ps file to a pdf file w/ searchable text? (pkfix-helper: No Type 3 fonts were encountered in the input file)
I try to use pkfix-helper to fix the pdf and then run ps2pdf on it. But I get the following error. Could you please let me know if there is any other way to generate a searchable pdf file? $pkfix-helper 0375.ps Reading 0375.ps ... done. Number of Type 3 fonts encountered: 0 pkfix-helper: No Type 3 fonts were encountered in the input file On May 13, 10:45=A0pm, Peng Yu <pengyu...@gmail.com> wrote: > I try to use pkfix-helper to fix the pdf and then run ps2pdf on it. > But I get the following error. Could you please let me know if there > is any other way to generate a searchable pdf file? > > $pkfix-helper 0375.ps > Reading 0375.ps ... done. > Number of Type 3 fonts encountered: 0 > pkfix-helper: No Type 3 fonts were encountered in the input file That looks more like a "nothing to do" message than an "error" per se. If we could see some of the postscript, ... On May 14, 12:41=A0am, luser- -droog <mijo...@yahoo.com> wrote: > On May 13, 10:45=A0pm, Peng =A0Yu <pengyu...@gmail.com> wrote: > > > I try to use pkfix-helper to fix the pdf and then run ps2pdf on it. > > But I get the following error. Could you please let me know if there > > is any other way to generate a searchable pdf file? > > > $pkfix-helper 0375.ps > > Reading 0375.ps ... done. > > Number of Type 3 fonts encountered: 0 > > pkfix-helper: No Type 3 fonts were encountered in the input file > > ...

Re: Exporting a SAS data set to Text file on SAS unix #3
hi ... actually, what I posted earlier was too much code (sorry) this is enough (a bit more succinct) * variable names into a macro variable (tab separated); proc sql noprint; select name into :vars separated by '09'x from dictionary.columns where libname eq 'SASHELP' and memname eq 'CLASS' order varnum; quit; data _null_; file 'z:\class.txt' dsd dlm='09'x ; if _n_ eq 1 then put "&vars"; set sashelp.class; put (_all_) (:); run; -- Mike Zdeb U@Albany School of Public Health One University Place Rensselaer, New York 12144-3456 P/518-402...

converting a text file into an "insert into ..." file
Hi, I have a csv delimited file that I'd like to 'insert into some_table table values ...' file. Thus I have a file where each row is of the sort: value1, value2, value3, value4 and I'd like to convert the file into a file where each row looks like:: insert into some_table values (value1, value2, value3, value4) How may I efficiently do this? Thanks for your help. gk In case you need escaping there is a module for parsing CSV in stdlib. http://www.ruby-doc.org/stdlib/libdoc/csv/rdoc/index.html otherwise just ruby -ne 'puts "insert into some_table values (#{$...

Converting .m (script file) to .txt (text file)
I have a bunch of .m files that need to be converted to .txt files. I want to be able to automate this to make the process easier, as there are many files that must be converted. Is there any function in MATLAB that can help in this automation process? Thank you William On 14 Jul, 18:52, "William Sipprell" <william.sippr...@gmail.com> wrote: > I have a bunch of .m files that need to be converted to .txt files. I wan= t to be able to automate this to make the process easier, as there are many= files that must be converted. =A0 > > Is there any function in MATLAB t...

How to convert utf-8 file to \u text file?
How to convert a utf-8 file to a wide text file with \u prefix? When I try to use [format {%2X %2X} [string index $s $i] [string index $s [expr $i+1]]] it said the format parameter must be integer but the string returns an ascii type. What is the problem? changli_to@hotmail.com (Chang LI) wrote: # How to convert a utf-8 file to a wide text file with \u prefix? # When I try to use # # [format {%2X %2X} [string index $s $i] [string index $s [expr $i+1]]] # # it said the format parameter must be integer but the string returns # an ascii type. # # What is the problem? \u 16-bit codes need %04x not %2x. You have to convert the character to its ASCII code before formatting as hexidecimal. % foreach ch {a b c d e} {puts [format %2x [scan $ch %c]]} 61 62 63 64 65 scan convert 16 bit Unicode characters to integer codes. binary scan can convert 8 bit bytes to integer code. set channel [open xx r] set result "" foreach ch [split [read $channel] {}] { set code [expr {[scan $ch %c]&0xFFFF}] if {$code>127} { append result [format \\%04X $code] } else { append result $ch } } puts $result \00E1Aa\00E9Ee\00EDIi\00F3Oo\00FAUu -- SM Ryan http://www.rawbw.com/~wyrmwif/ One of the drawbacks of being a martyr is that you have to die. SM Ryan <wyrmwif@tango-sierra-oscar-foxtrot-tango-dot-charlie-oscar-mike.fake.org> wrote in message news:<1090g372j5j5t93@corp.supernews.com>... > set channel [open xx r] > set result "" > forea...

Re: How to convert SAS file to .v5x file? #2
As of version 7 SAS libraries were not backwards compatible (for writing) with version 5. If you have a third party application that needs a SASv5.18 file then you'll need to export from SAS to a different compatible filetype from that era such as CSV, WK1, or dbase that your application can import. Paul Choate DDS Data Extraction (916) 654-2160 -----Original Message----- From: Choate, Paul@DDS [mailto:pchoate@DDS.CA.GOV] Sent: Friday, January 23, 2004 3:36 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: How to convert SAS file to .v5x file? Miranda - What application is a .v5x file? Are ...

Re: convert SPSS file to text
Use DBMS Copy. Dennis G. Fisher, Ph.D. Professor and Director Center for Behavioral Research and Services California State University, Long Beach 1090 Atlantic Avenue Long Beach, CA 90813 tel: 562-495-2330 x121 fax: 562-983-1421 -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Tonkovich, Mike Sent: Tuesday, January 13, 2009 4:32 AM To: SAS-L@LISTSERV.UGA.EDU Subject: convert SPSS file to text Good morning, Can anyone out there help me convert an SPSS file to anything but an SPSS file? A text file, SAS dataset, Access table... I would greatly appreciate the help. They are very small files so I could email them to you. Mike ...

Web resources about - Re: Converting A Unicode Text File to An ASCII Text File - comp.soft-sys.sas

Facebook Begins Converting Users To HTTPS
Are you willing to sacrifice a little bit of speed for a lot more safety? Facebook is asking that very question with its announcement that it ...

Facebook No Longer Converting Groups Into Pages
Back when Facebook first launched Facebook Pages, many businesses and brands who had built up substantial audiences in their Facebook Groups ...

Vert - simply converting for iPhone, iPad, and iPod touch on the iTunes App Store
Get Vert - simply converting on the App Store. See screenshots and ratings, and read customer reviews.

Converting SIM Card to Micro SIM Card - Flickr - Photo Sharing!
Place new Micro SIM into the iPhone SIM card tray

Ayaan Hirsi Ali on Converting Muslims to Christianity - YouTube
Complete video at: http://fora.tv/2010/07/29/Nomad_From_Islam_to_America_with_Ayaan_Hirsi_Ali Ayaan Hirsi Ali explains her support of missionary ...

Converting dry air to water: solution to Broken Hill's water crisis gains support
A one-man crusade by a Broken Hill resident to solve the historic town's water crisis by introducing air to water converters is gaining support. ...

Click go fears of converting print files
Is there a way to convert a print queue item to a .RTF or .PDF file? I like to save or email them. - The Sydney Morning Herald

Sudanese woman ordered to hang under sharia law for converting to Christianity gives birth
Khartoum, Sudan: A Christian Sudanese woman sentenced to hang for apostasy has given birth in jail, a Western diplomat said on Tuesday.

Imams warn against radicalism to Aboriginal inmates converting to Islam
The prison system has enlisted the help of ASIO to crack down on radicalisation behind bars amid revelations that Aboriginals are converting ...

Converting the world's companies one by one - The Science Show - ABC Radio National (Australian Broadcasting ...
Image: Trucks carrying logs make their way up a road in Jambi, Indonesia. A vast area of the Sumatran forest, and orangutan habitat, is being ...

Resources last updated: 3/17/2016 7:11:56 AM