perl problem when download sec files
Posted: 11 August 2014 09:04 AM   [ Ignore ]
Newbie
Rank
Total Posts:  4
Joined  2014-08-11

Hi,

I obtained the c_10K_list.txt based on the sas code provided from tutorials, however, there is a problem when I try to download SEC files using “Perl download.pl”. The error is no such file or dictionary at d:\secfilings\download.pl line 28”. Line 28 of the Perl code is: “open dlthis, “c_10K_list.txt” or die $!;” I can’t figure this problem out even have spend whole day on it. Does anyone know the reason or has come across this problem before?

Many thanks,
Lin

Profile
 
 
Posted: 11 August 2014 09:08 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Lin,

The error provided suggests that c_10K_list.txt does not exist. Are you sure the file has the right name, and is it in the same directory as download.pl?

best regards,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile
 
 
Posted: 11 August 2014 09:16 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  4
Joined  2014-08-11

Thanks for reply Joost,

yes, both files are in D:\SECfilings\npx. So I’m really confused about it.

Best,
Lin

File Attachments
download.pl  (File Size: 2KB - Downloads: 0)
Profile
 
 
Posted: 11 August 2014 09:23 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Lin,

The forum software does not seem to ‘accept’ perl (.pl) as a valid extension (I can’t view the file). Can you rename the file as ‘download.txt’ and attach it again?

Thanks,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile
 
 
Posted: 11 August 2014 09:26 AM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  4
Joined  2014-08-11

attached following

File Attachments
download.txt  (File Size: 2KB - Downloads: 232)
Profile
 
 
Posted: 11 August 2014 09:35 AM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Lin,

It is puzzling indeed.

First, remove the 2 last lines of your file (they do not seem to be causing the error, but will cause problems). (the lines #ignore.. and </dlthis>)

Are you executing the program from the directory D:\SECfilings\npx?
cd D:\SECfilings\npx
perl download.pl

If you did:
cd D:\
perl SECfilings\npx\download.pl it may look for the file in D:\

If that doesn’t work, focus on the reading of the file. First, rename the file to something basic like “a.txt”. If the name is right - it probably is smile - then, remove all code except the code to read a file. In other words, write the most basic perl program that just reads a file, nothing else. Once that works, include that code into download.pl.

Hope this helps,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile
 
 
Posted: 11 August 2014 09:46 AM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  4
Joined  2014-08-11

Thx Joost,

Yes, the command I used is right.

But I’m very new in Perl. It’s my first day (only for the purpose of downloading SEC files). I even don’t know how to read files by Perl. So, should I study Perl from very beginning? Is Perl the best tool to download? Can SAS do it? I know SAS better.

Best,
Lin

Profile
 
 
Posted: 11 August 2014 10:01 AM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Lin,

If you have time to learn perl, I think it would be a great asset for your ‘toolbox’.

Try Googling ‘perl load file’, you will find many examples.

best regards,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile