How can I read and write data from exel file?

how can I read data from exel file and also can edit exel file with ou

Page 1 of 1

7 Replies - 2818 Views - Last Post: 12 August 2009 - 02:49 AM Rate Topic: -----

#1 sagar01sumi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 10-September 08

How can I read and write data from exel file?

Post icon  Posted 10 September 2008 - 04:00 AM

how can I read data from exel file and also can edit exel file with out opening exel file from C.
Is This A Good Question/Topic? 0
  • +

Replies To: How can I read and write data from exel file?

#2 sensui  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 30
  • View blog
  • Posts: 146
  • Joined: 24-August 08

Re: How can I read and write data from exel file?

Posted 10 September 2008 - 04:08 AM

Do you mean EXCEL ( .XLS; the Microsoft proprietary format for spreadsheets ) or EXE ( the Microsoft Portable Executable format for executables ) ?
Was This Post Helpful? 0
  • +
  • -

#3 gabehabe  Icon User is offline

  • GabehabeSwamp
  • member icon




Reputation: 1384
  • View blog
  • Posts: 10,962
  • Joined: 06-February 08

Re: How can I read and write data from exel file?

Posted 10 September 2008 - 04:09 AM

Pretty sure he/she said "Excel" plenty of times ;)

The best way to do it is with a CSV file (comma separated) since it's the easiest format to work with. :)
Was This Post Helpful? 1
  • +
  • -

#4 mangesh.kadu  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 1
  • Joined: 21-January 09

Re: How can I read and write data from exel file?

Posted 21 January 2009 - 09:16 PM

View Postgabehabe, on 10 Sep, 2008 - 03:09 AM, said:

Pretty sure he/she said "Excel" plenty of times ;)

The best way to do it is with a CSV file (comma separated) since it's the easiest format to work with. :)


How to do with csv file could you tell me or do u have any tutorial?
Was This Post Helpful? 1
  • +
  • -

#5 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5382
  • View blog
  • Posts: 27,350
  • Joined: 10-May 07

Re: How can I read and write data from exel file?

Posted 21 January 2009 - 09:19 PM

Excel is a program that can open spreadsheets. Surely you have a much more direct goal in mind? A specific file type perhaps?

View Postmangesh.kadu, on 21 Jan, 2009 - 10:16 PM, said:

How to do with csv file could you tell me or do u have any tutorial?

You would have to parse the csv.
Was This Post Helpful? 0
  • +
  • -

#6 matthew180  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 51
  • View blog
  • Posts: 202
  • Joined: 07-January 09

Re: How can I read and write data from exel file?

Posted 21 January 2009 - 09:44 PM

Although Excel will read (and can be made to write) CSV files, that is not the same as a native .xls file. Are you trying to produce a file that Excel can consume, or are you trying to do something with a native .xls file produced by Excel?

If you are trying to read a native .xls file, then good luck and tell me how you did it. ;) Microsoft does not publish their native formats (.doc, .xls, etc.) so any programs that do read the files directly have required people doing reverse engineering to figure out how the files are structured (even then they cannot be certain they cover every possibility). The NTFS is a similar situation and the reason you don't see many alternate operating systems with the ability to *write* to an NTFS file system. Anyway, I digress.

The CSV solution is a good option if you are producing files for Excel to consume, or if you can control what Excel produces (i.e. use save-as to produce a CSV file). However, CSV will only support row and column data, there can be no other "spreadsheet" type information in a CSV file like formulas, layout information, etc..

Matthew
Was This Post Helpful? 0
  • +
  • -

#7 haiyun211  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 58
  • Joined: 27-July 09

Re: How can I read and write data from exel file?

Posted 11 August 2009 - 09:40 AM

View Postmatthew180, on 21 Jan, 2009 - 08:44 PM, said:

Although Excel will read (and can be made to write) CSV files, that is not the same as a native .xls file. Are you trying to produce a file that Excel can consume, or are you trying to do something with a native .xls file produced by Excel?

If you are trying to read a native .xls file, then good luck and tell me how you did it. ;) Microsoft does not publish their native formats (.doc, .xls, etc.) so any programs that do read the files directly have required people doing reverse engineering to figure out how the files are structured (even then they cannot be certain they cover every possibility). The NTFS is a similar situation and the reason you don't see many alternate operating systems with the ability to *write* to an NTFS file system. Anyway, I digress.

The CSV solution is a good option if you are producing files for Excel to consume, or if you can control what Excel produces (i.e. use save-as to produce a CSV file). However, CSV will only support row and column data, there can be no other "spreadsheet" type information in a CSV file like formulas, layout information, etc..

Matthew


Hi Matthew,

I was wondering if you know how to make it so I can store data in CSV file and then recall that data? And also how to write the data to a file without overwriting the origanal data?

This post has been edited by haiyun211: 11 August 2009 - 12:18 PM

Was This Post Helpful? 0
  • +
  • -

#8 jeff666  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 193
  • Joined: 30-December 08

Re: How can I read and write data from exel file?

Posted 12 August 2009 - 02:49 AM

View Postmatthew180, on 21 Jan, 2009 - 08:44 PM, said:

If you are trying to read a native .xls file, then good luck and tell me how you did it. ;)


It's trivial with COM, same methods than on Win95 (dozens of samples in MSDN in VB, C and C++...)
You don't care about XLS format with COM...

This post has been edited by jeff666: 12 August 2009 - 02:51 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1