Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy a file from data on my website
Message
From
28/01/2011 19:06:17
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Copy a file from data on my website
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01497730
Message ID:
01497730
Views:
101
Hello,

I need to pull information from a website into FoxPro. The information is within a .txt file (comma delimited) on the website server.

Ideally, I'd just like to copy the .txt files on to my hard drive and manipulate them further in FoxPro. When I try to:

copy file "http://www.MYWEBSITE.com/_private/form_results10.txt" to c:\hold\form_results10.txt

I get the error "Invalid path or filename". I tried something else earlier (don't recall what it was) that led me to believe FoxPro was "stuck" within the C:\ drive (something like it couldn't find c:\http://...).

I also tried writing a macro in Excel to open the .txt file there and manipulate it. I'm not sure how to tweak that code to actually work.

If there is a way to just copy the files, that's perfect. If not, help converting the following macro to "FoxSpeak" would be greatly appreciated.

Thanks,
Martha Kroll


Sub Macro1()
'
' Macro1 Macro
' Macro recorded 1/28/2011 by Martha Kroll
'

'
ChDir "http://www.rivercitymotorsusedcars.com/_private"
Workbooks.OpenText Filename:= _
"http://www.MYWEBSITE.com/_private/form_results10.txt", Origin _
:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote _
, ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:= _
True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), _
Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 3), Array(7, 1)), TrailingMinusNumbers _
:=True
Selection.Copy
Range("A2").Select
ActiveSheet.Paste
Range("A1").Select
Application.CutCopyMode = False
Selection.EntireRow.Delete
End Sub
Next
Reply
Map
View

Click here to load this message in the networking platform