Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 136,321 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,733 people online right now. Registration is fast and FREE... Join Now!




import data from flat file

 
Reply to this topicStart new topic

import data from flat file, count number of column in flat file

jaiverma
1 Sep, 2008 - 12:37 AM
Post #1

New D.I.C Head
*

Joined: 1 Sep, 2008
Posts: 2

I am import data in MSSQL from flat file using bcp utility
this is my flat file format

0807þPK7557þ50012þÿ0807þPK7557þ50019þÿ0807þPK7557þ50016þÿ

Column delimiter - þ
Row Delimiter - ÿ

I want to count no. of column from text file before import the data to match the no. of columns in database.

Please Help
Jai
User is offlineProfile CardPM
+Quote Post

dineeshd
RE: Import Data From Flat File
1 Sep, 2008 - 03:10 AM
Post #2

D.I.C Addict
Group Icon

Joined: 30 Jun, 2008
Posts: 578



Thanked: 16 times
Dream Kudos: 575
My Contributions
Use the below function to count the string þ. The out put number will be the column count.

Count the Number of Occurrences of a Character Sequence in a String


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 07:25AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month