I have a Tab delimited file: Field1<tab>Fiel d2<tab>...<Fiel d20><crlf>
There must be an easy way to break this apart, but I haven't found it yet.
Can anyone help?
Regards,
Ot 2 1507
* "Ot" <ur***@tds.inva lid (use net)> scripsit: I have a Tab delimited file: Field1<tab>Fiel d2<tab>...<Fiel d20><crlf>
There must be an easy way to break this apart, but I haven't found it yet.
You can use 'Split' to split the lines.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Sure. String.Split() is going to be your friend here. It will split the
string into an array of strings - for your example, splitting on <tab> would
give you an array of strings { "Field1", "Field2", "...","Field20" }
Here's an example that will read in each line, then print out each field on
it's own line:
------------------------------------
Imports System.IO
Module Module1
Sub Main()
Dim reader As New StreamReader("c :\filename.txt" )
Dim oneLine As String = reader.ReadLine ()
While Not oneLine Is Nothing
Dim vals() As String = oneLine.Split(v bTab)
'Do something interesting with the array of strings
Dim s As String
For Each s In vals
Console.WriteLi ne(s)
Next
oneLine = reader.ReadLine ()
End While
End Sub
End Module
-------------------------------------------
"Ot" <ur***@tds.inva lid (use net)> wrote in message
news:Om******** ******@TK2MSFTN GP12.phx.gbl... I have a Tab delimited file: Field1<tab>Fiel d2<tab>...<Fiel d20><crlf>
There must be an easy way to break this apart, but I haven't found it yet. Can anyone help?
Regards, Ot
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: monte |
last post by:
Hello, I need to parse a tilde delimited file and output it to a
tabbed delimited file. Example file example.txt
data1~data2~data3~data4
data5~data6~data7~data8
I need to extract data2, data4, data6 and data8 from the above file
and output it to a file delimited by tabs:
data2 data4 data6 data8
|
by: Skc |
last post by:
I am trying to import a file using a custom VB.net procedure, but the problem
is it works on a file with pure comma separation and not inverted commas and
commas, i.e. it works for AAA,BBB,CCC,DDD but not for "AAA","BBB","CCC","DDD".
Here is an extract from the code which needs to be modified for the """:
Sub LoadTextFile(ByVal strFilePath As String)
Dim oDS As New DataSet()
Dim strFields As String
Dim oTable As New DataTable()
|
by: Ben |
last post by:
Hi all -
I am having a bit of trouble and thought maybe someone in this group
could shed some light. Here's the skinny...
I am creating an automated process to import a bunch of text files
into Access. I want to avoid creating a separate "Spec" for each file
(there are over 180 files) and instead want to code my own dynamic
importing rules. So far it's been going fine, except for one item...
|
by: Karl Irvin |
last post by:
I'm using the Write # statement to create a csv export file from Access 2K
Some of the data has embedded quotes in it and it doesn't import into
QuickBooks correctly.
An inventory part with a name of 1/4" Pipe gets truncated to 1/4
with csv
Can I create a tab delimited file with Aceess and include the quote mark.
|
by: The Bear |
last post by:
I have populated a dataset with a tab delimited text file.
When the changes are made in the dataset, I then want to write those changes
from the dataset to a tab delimited text file. How do I write each record to
that text file.
If anyone one knows I would really appreciate the help
TB
| |
by: TJS |
last post by:
attempting to read a delimited text file into a dataset using oledb text
file connection
getting this error message when trying to open connection
----------------------------------------------------
System.Data.OleDb.OleDbException:
No error information available: E_NOINTERFACE(0x80004002).
----------------------------------------------------
I have the schema.ini file in the folder with the delimited text file
|
by: Masa Ito |
last post by:
I have pipe delimited (and comma/tab) files that I read with JET using a
schema file. Occasionally a field has multiple quotes (") inside a single
field - which chokes the line (the rest of the columns get read as
nulls). An example of an offending line is:
J" Invalid " ....
This is a text field that is between the two 'pipes' so I need it read
exactly as is.
I have reverted to schema files, trying everything I can to overcome this...
|
by: =?Utf-8?B?UmljaA==?= |
last post by:
'--this code works but only reads text into one column when contains multiple
cols
Dim ds1x As New DataSet
Dim ConStr As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\dir1A\;Extended
Properties=""Text;HDR=No;FMT=Delimited\"""
Dim conn1x As New OleDb.OleDbConnection(ConStr)
Dim dax1 As New OleDbDataAdapter("Select * from testabc1x.txt", conn1x)
|
by: RyanL |
last post by:
I'm a newbie! I have a non-delimited data file that I'd like to
convert to delimited.
Example...
Line in non-delimited file:
0139725635999992000010100534+42050-102800FM-15+1198KAIA
Should be:
0139,725635,99999,2000,01,01,00,53,4,+42050,-102800,FM-15,+1198,KAIA
|
by: nick777 |
last post by:
Hope the Community can bear with me as I muddle with the vocabulary since I am not really sure if I am going about this the correct way.
My question is as follows:
If I had some sample data in the form of delimited text, in this case comma-delimited (eg. canned_data.txt) and the format looked roughly like this:
name,age,occupation,status
"joe blow",21,salesman,married
"hanna montana,19,entertainer,single
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
| |
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |