Hello!
could anyone help me import this file into SAS?
the extension name is not .txt but it can be read by notepad,I want import this file into SAS without change its extension name(if I change .srt to .txt it will works but i want see whether we don't need to change it).
data one
infile "C:\Users\Lost - [2x07] - The Other 48 Days.XviD-LOL.English.srt;
input contens;
run;
please see attachment.
Thanks!
Mike
You haven't provided any information on the desired output, so I am assuming that you just simply want it read in.
DATA WORK.Lost____2x07____The_Other_48_Day;
LENGTH
F1 $ 2000 ;
FORMAT
F1 $CHAR40. ;
INFORMAT
F1 $CHAR40. ;
INFILE 'E:\Lost - [2x07] - The Other 48 Days.XviD-LOL.English.SRT'
LRECL=2000
TERMSTR=CRLF
TRUNCOVER ;
INPUT
@1 F1 $CHAR2000. ;
RUN;
and if Mike just wants to view it in SAS
PROC FSLIST FILE= "that file";
RUN;
If you run the following code (corrected missing ") what are the messages?
The infile statement does not care for extensions. With SAS never experienced... SAS(R) 9.4 Statements: Reference
SAS(R) 9.4 Companion for Windows (infile - referencing external files)
By the way, It is really simple short ascii file with 3 record/obs (1/ recno, 2/ timing info 3/ message line(s) segregated by blank line)
data one
infile "C:\Users\Lost - [2x07] - The Other 48 Days.XviD-LOL.English.srt" ; /* added the quotes */
input ; put _infile_ ;
run;
As others have stated, you are missing a closing quotation mark at the end of your infile statement fileref. The file format is also quite simple.
data subs;
infile '/path/to/file.srt' truncover ;
input #1 id
#2 xstart_time $12. +5 xend_time $12.
#3 sub $200.
#4
;
format start_time end_time time12.3 ;
start_time = input( translate( xstart_time , '.' , ',' ) , time12. ) ;
end_time = input( translate( xend_time , '.' , ',' ) , time12. ) ;
drop xstart_time xend_time;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: