I copied a table from a pdf file that contained Exam Code and Exam Name and pasted it into Excel. The results were pasted into one column instead of two separate ones. I want to read the data like so:
Data I want:
Exam_Code Exam_Name
7 United States History
13 Art History
14 Studio Art: Drawing Portfolio
.
.
.
Data I have in Excel. (I also pasted it into Notepad with similar results).
7 |
United States History |
13 |
Art History |
14 |
Studio Art: Drawing Portfolio |
15 |
Studio Art: 2-D Design Portfolio |
16 |
Studio Art: 3-D Design Portfolio |
@GreggB: Then why not just input it the same way, i.e.:
data want; informat Exam_Name $50.; input Exam_Code/ Exam_Name &; cards; 7 United States History 13 Art History 14 Studio Art: Drawing Portfolio ;
Art, CEO, AnalystFinder.com
@GreggB: Then why not just input it the same way, i.e.:
data want; informat Exam_Name $50.; input Exam_Code/ Exam_Name &; cards; 7 United States History 13 Art History 14 Studio Art: Drawing Portfolio ;
Art, CEO, AnalystFinder.com
If you have Adobe Professional it can convert the doc to Excel or Word and will save the formatting, at least better than copy and paste.
If you don't have Adobe Professional, you can use the second file, the txt file and easily read that in using SAS.
data want;
infile 'path to text file' truncover;
input number / name $20.;
run;
Not actually a SAS related question.
You likely need a PDF viewer/editor that has a "Copy TABLE" option to maintain the "columns" in the PDF table. If the PDF data is NOT a table then you're likely going to have a lot of work if you want the result in Excel.
Note that SAS can read that pasted text file (notepad) with a proper data step. Something like
data want;
infile 'c:\path\filename.txt' truncover;
informat exam_code best5. exam_name $50.;
input exam_code
/exam_name 1-50;
run;
I don't want the result in Excel. I was just trying to think of a way to get SAS to read it. I should have pasted directly to the text editor.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.