hi all,
read a tab delimited file and store it in a database using cf
Thanks,
meenaksh
2 Replies - 12729 Views - Last Post: 08 January 2007 - 10:04 PM
#1
read a tab delimited file and store it in a database using cf
Posted 08 January 2007 - 03:59 AM
Replies To: read a tab delimited file and store it in a database using cf
#2
Re: read a tab delimited file and store it in a database using cf
Posted 08 January 2007 - 07:06 AM
Let us first start out with what is wrong here. Per forum rules you must demonstrate that you have put actual coding effort into your project with your own code.
So please, take a crack at it.
Tips:
1. You'll need CFFILE
2. For reading a line you can possibly treat each tab-delimited column as a list item, therefore the list commands like ListGetAt and ListLen can apply.
Good luck.
So please, take a crack at it.
Tips:
1. You'll need CFFILE
2. For reading a line you can possibly treat each tab-delimited column as a list item, therefore the list commands like ListGetAt and ListLen can apply.
Good luck.
#3
Re: read a tab delimited file and store it in a database using cf
Posted 08 January 2007 - 10:04 PM
psykoprogrammer, on 8 Jan, 2007 - 07:06 AM, said:
Let us first start out with what is wrong here. Per forum rules you must demonstrate that you have put actual coding effort into your project with your own code.
So please, take a crack at it.
Tips:
1. You'll need CFFILE
2. For reading a line you can possibly treat each tab-delimited column as a list item, therefore the list commands like ListGetAt and ListLen can apply.
Good luck.
So please, take a crack at it.
Tips:
1. You'll need CFFILE
2. For reading a line you can possibly treat each tab-delimited column as a list item, therefore the list commands like ListGetAt and ListLen can apply.
Good luck.
hi
i did that
<cfset filepath = "C:\CFusionMX\wwwroot\SalesCustomer.txt">
<cffile action="read" file="#filepath#" variable="fileData">
<cfloop index="record" list="#fileData#" delimiters="#chr(10)#,#chr(9)#">
<cfquery name="Q_insert" datasource="#dsn#">
insert into Clients (ClientName) values ('#record#')
</cfquery>
<cfquery name="Q_select" datasource="#dsn#">
select * from Clients
</cfquery>
</cfloop
thanks,
meenaksh
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|