473,386 Members | 1,674 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,386 software developers and data experts.

How to submit data from diff text files into database automatically

38
Hi,
My problem is this i am collecting some information into .txt text files, now i have to submit those values in database daily.I am writing my code in asp,sql server database.

I have one query::

Can i write a job that can access text files and submit data.
May 15 '08 #1
1 1791
jeffstl
432 Expert 256MB
Hi,
My problem is this i am collecting some information into .txt text files, now i have to submit those values in database daily.I am writing my code in asp,sql server database.

I have one query::

Can i write a job that can access text files and submit data.
Yes.

As long as your text file data is formatted in a specific and consistent way that you know the length of strings you need to select, or if the data is deliminated with commas, spaces, etc something.

Like this:
Name,Address,HomePhone,Comments
Or
Name Address HomePhone

Then you need to use the File System Object to read each line of the text file in and populate variables, then write it to database using SQL.

This is a simple read example of reading a text file. You will then need to use the VB String functions to extract individual data elements you will need. At the bottom is a link to various string extract functions
Expand|Select|Wrap|Line Numbers
  1.     Set fs=Server.CreateObject("Scripting.FileSystemObject")
  2.     Set f=fs.OpenTextFile(FileName, 1)
  3.     do while f.AtEndOfStream = false
  4.          Response.Write(f.ReadLine)
  5.          Response.Write("<br>")
  6.     loop
  7.     f.Close
  8.     Set f=Nothing
  9.     Set fs=Nothing
  10.  
  11.  

MID Function Left Function
May 15 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Eric | last post by:
Hey Everyone.. I have a form that has approximately 7 text fields and 1 checkbox. Generally when this form is submitted(to itself BTW) it works fine, however, when the checkbox is only field...
1
by: Dan | last post by:
Could someone please help me with auto importing a series of data files into an Access table. I tried to follow code given below in a previous messagebut i'm getting error messages. Here's my...
4
by: Zen | last post by:
I'm using Access 2000, and I'd like to know if there is a way to use a scanner (flatbed, doc-feed, etc) to scan forms with OMR or OCR software, and have the data be automatically (or if not...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
0
by: Lance Geeck | last post by:
Hi, I am trying to learn the VB.NET approach and am having problems with updating the database. What I have is a simple windows form using text boxes for entering name, address and phone. It is...
2
by: Kevin Walzer | last post by:
What's the best way to submit patches for Python documentation at the SourceForge patch tracker if you are not writing LaTeX? I would like to submit some simple text updates. However, if I do this,...
4
ganesanji
by: ganesanji | last post by:
Hi, I have written a simple php coding for getting the name , phone number and insert the values into data base. My problem is that when ever I just click the refresh button in the browser...
11
by: V S Rawat | last post by:
using Javascript, I am opening a web-based url in a popup window. MyWin1=Window.Open(url, "mywindow") There is a form (form1) in the url in that popup window, I need to submit that form. ...
6
by: Aaron Gray | last post by:
Hi, I am working on an HTML WYSISYG Wiki and need to display a diff page like WikiPedia does if two people edit a file at the same time to give the second user the diff. Basically with additions...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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.