473,387 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

read csv file in iframe as text file

Hi,
I am trying to load a csv file in Iframe element. I just want to
load it as a text file.
however when i load the file in iframe it asks to open the file and
finally opens it with excel in IE window itself. If i save the save
file as .txt it is being read properly.I need to save the file in csv
format only so that it can be edited externally with excel easily.
Later on i want to display the read csv file in javascript and do some
processing on it.
Does any know how do this. The basic problem is to stop IE from
invoking excel to open csv file and instead read the file as text.

Following code works for .txt file

<iframe name="loader" id="frm" width="1000" height="300"
style="visibility:hidden;display:none" src="Book1.txt"></iframe>

and when i use this line it tries to open the file using excel which i
don't want.

<iframe name="loader" id="frm" width="1000" height="300"
style="visibility:hidden;display:none" src="Book1.csv"></iframe>

Any suggestions?
Thanks
Sukhmeet

Jan 15 '08 #1
4 12172
On Jan 15, 1:18*am, sukhm...@gmail.com wrote:
Hi,
* I am trying to load a csv file in Iframe element. I just want to
load it as a text file.
however when i load the file in iframe it asks to open the file and
finally opens it with excel in IE window itself. If i save the save
file as .txt it is being read properly.I need to save the file in csv
format only so that it can be edited externally with excel easily.
Later on i want to display the read csv file in javascript and do some
processing on it.
* Does any know how do this. The basic problem is to stop IE from
invoking excel to open csv file and instead read the file as text.

Following code works for .txt file

<iframe name="loader" id="frm" width="1000" height="300"
style="visibility:hidden;display:none" src="Book1.txt"></iframe>

and when i use this line it tries to open the file using excel which i
don't want.

<iframe name="loader" id="frm" width="1000" height="300"
style="visibility:hidden;display:none" src="Book1.csv"></iframe>

Any suggestions?
* Thanks
Sukhmeet
Bart is correct. However, why not just change the file extension?
Book1.xxx, for example. Or don't use a file extension at all. Later on
why you want to open it up in excel, just go into excel and open the
file. You may have to change the file type on the open file dialogue
window. Just don't allow Excel to create a new file extension
association with 'xxx' or whatever you use.
Jan 15 '08 #2
Doug Gunnoe wrote:

[...]
Bart is correct. However, why not just change the file extension?
Book1.xxx, for example. Or don't use a file extension at all. Later on
why you want to open it up in excel, just go into excel and open the
file. You may have to change the file type on the open file dialogue
window. Just don't allow Excel to create a new file extension
association with 'xxx' or whatever you use.
If the objective is that admin edits the CSV-file directly in Excel
(e.g. when opening it using a FTP-path in Excel and saves it back),
then I believe it's better to keep the .csv-extension. This way the
editing can be performed with maximum user-friendliness for admin. The
extension doesn't matter for XMLHttpRequest as it always parses the
raw data.

--
Bart
Jan 15 '08 #3
On Jan 15, 7:40*am, Bart Van der Donck <b...@nijlen.comwrote:
If the objective is that admin edits the CSV-file directly in Excel
(e.g. when opening it using a FTP-path in Excel and saves it back),
then I believe it's better to keep the .csv-extension. This way the
editing can be performed with maximum user-friendliness for admin.
OK. I didn't catch that. I just though the OP wanted to open in it up
in Excel from time to time and edit it, but did not want the browser
to open it up like a spreadsheet.
The extension doesn't matter for XMLHttpRequest as it always parses the
raw data.
But changing the extension keeps IE from associating the file with
Excel and trying to open it up as a spreadsheet in the browser.

But I see your point. It would be a pain if you had to edit the file
frequently or if you had multiple users who needed to edit the file.

Jan 15 '08 #4
On Jan 15, 7:40 am, Bart Van der Donck <b...@nijlen.comwrote:
If the objective is that admin edits the CSV-file directly in Excel
(e.g. when opening it using a FTP-path in Excel and saves it back),
then I believe it's better to keep the .csv-extension. This way the
editing can be performed with maximum user-friendliness for admin.
OK. I didn't catch that. I just though the OP wanted to open in it up
in Excel from time to time and edit it, but did not want the browser
to open it up like a spreadsheet.
The extension doesn't matter for XMLHttpRequest as it always parses the
raw data.
In regard to the way the OP was doing it, changing the extension keeps
IE from associating the file with Excel and trying to open it up as a
spreadsheet in the browser.

But I see your point. It would be a pain if you had to edit the file
frequently or if you had multiple users who needed to edit the file.

Your solution is the best way.
Jan 15 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tom Van Overbeke | last post by:
Hi, I created a web page that displays a logfile monitor i wrote for monitoring our servers. it refreshes every minute and displays a text file in an iframe. I'd like to reduce the font size so...
7
by: Nik Coughin | last post by:
Is there a simple way of opening a text file from a server, and reading from it line by line? IE http://someserver/file.txt contains a couple of hundred lines. Each line is the name of a...
12
by: A.M. | last post by:
Hi at all, how can I do to insert into a HTML page a file .txt stored in the same directory of the server where is the html file that must display the text file.txt? Thank you very much P.Pietro
6
by: Divya | last post by:
Hi, I have a web page which generates a CSV file based on some user input. When this file is downloaded by the user, the file is being automatically converted to .xls. Any idea how I can prevent...
1
by: j7.henry | last post by:
I am trying to pull specific data that is in a comma delimited file into a web page. So if my comma delimited file looks like: Name,Address,Zip Fred,123 Elm,66666 Mike,23 Jump,11111 I would...
0
by: tequilamala | last post by:
I have an Iframe in one of the pages i am developing... the iframe is suppose to scroll up and down and the links target the iframe. the problem is that the iframe scrolls side to side on internet...
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.