Results 1 to 5 of 5

Thread: Read a csv file from Internet

  1. #1
    Join Date
    Feb 2010
    Posts
    31
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Windows

    Post Read a csv file from Internet

    Hi

    I am a newbee in Qt4. I am trying to read a file which is on the web, e.g.:
    from http://download.finance.yahoo.com/d/...1c1ohgv&e=.csv.
    without downloading it.

    I am able to read a local csv file. But when I am trying to read this file, the file cannot be found.

    Also I want to refresh the reading every 5 secs.

    How can I do it?

    Thanks in advance.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Read a csv file from Internet

    How are you reading from the net ?

  3. #3
    Join Date
    Feb 2010
    Posts
    31
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Windows

    Default Re: Read a csv file from Internet

    Hi aamer4yu

    That is the problem I am facing. I cannot read the file online. If I download it to local system, everything is fine.

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Read a csv file from Internet

    WHAT are you using to access the file on the net?

    Maybe have a look at QNetworkAccessManager/QNetworkRequest/QUrl ?

    A typical usage might be manager->get(QNetworkRequest(QUrl("http://download.finance.yahoo.com/d/quotes.csv?s=DLF.NS&f=sl1d1t1c1ohgv&e=.csv")));

    The call is asynchronous - you'll get your data in the appropriate slot.

  5. #5
    Join Date
    Feb 2008
    Posts
    153
    Thanks
    40
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Read a csv file from Internet

    You HAVE to download an item to read it. That's how all browsers do it. You can use QTemporaryFile to create a temporary file on the filesystem, and delete it when you're done.

    ~codeslicer
    [WIKI]Building Qt on Windows CE[/WIKI]

Similar Threads

  1. Read binary file
    By jaca in forum Qt Programming
    Replies: 9
    Last Post: 28th March 2012, 08:38
  2. read from file two lines
    By mmm286 in forum Newbie
    Replies: 6
    Last Post: 26th October 2009, 12:42
  3. is qt phonon can read realmedia file and divx file
    By fayssalqt in forum Qt Programming
    Replies: 1
    Last Post: 27th January 2009, 15:42
  4. Replies: 1
    Last Post: 20th June 2008, 18:43
  5. Read An Xml File
    By Alienxs in forum Qt Programming
    Replies: 3
    Last Post: 5th January 2007, 00:28

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.