07-29-2013 03:33 PM
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).
infile "C:\Users\Lost - [2x07] - The Other 48 Days.XviD-LOL.English.srt;
please see attachment.
07-29-2013 08:04 PM
You haven't provided any information on the desired output, so I am assuming that you just simply want it read in.
F1 $ 2000 ;
F1 $CHAR40. ;
F1 $CHAR40. ;
INFILE 'E:\Lost - [2x07] - The Other 48 Days.XviD-LOL.English.SRT'
@1 F1 $CHAR2000. ;
07-30-2013 07:46 AM
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)
infile "C:\Users\Lost - [2x07] - The Other 48 Days.XviD-LOL.English.srt" ; /* added the quotes */
input ; put _infile_ ;
07-30-2013 08:19 AM
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.
infile '/path/to/file.srt' truncover ;
input #1 id
#2 xstart_time $12. +5 xend_time $12.
#3 sub $200.
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;