473,507 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Removeing leading Tab from each line in a text file

I have a text file that is about 5000 line long. Each line begins with a
TAB. I'm trying to loop through the file a line at a time and remove the TAB
but can't figure out how. I tried a substring with no luck. How can I
accomplish this?

Thanks,
John
Nov 21 '05 #1
3 990
Hi John hope this helps,

Dim Line As String
Line.Replace(vbTab, "")

Henry

"jcrouse" <me> wrote in message news:<uG**************@TK2MSFTNGP15.phx.gbl>...
I have a text file that is about 5000 line long. Each line begins with a
TAB. I'm trying to loop through the file a line at a time and remove the TAB
but can't figure out how. I tried a substring with no luck. How can I
accomplish this?

Thanks,
John

Nov 21 '05 #2
John,

If you are sure it is the first position I just would do while reading

line = line.substring(1)

(You wrote you used substring however I am not sure if it was this one)

That removes the first position

Cor
I have a text file that is about 5000 line long. Each line begins with a
TAB. I'm trying to loop through the file a line at a time and remove the TAB but can't figure out how. I tried a substring with no luck. How can I
accomplish this?

Nov 21 '05 #3
Henry,

Just a little addition.

Dim Line As String
Line.Replace(vbTab, "")


This replaces all tabs, the alternative is in my opinion when it is not
surely the first position to use the Visual.Basic replace method with wich
you can do a replace only one time.

http://msdn.microsoft.com/library/de...fctreplace.asp
Cor

Nov 21 '05 #4

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

Similar topics

12
3260
by: dan glenn | last post by:
Hi. I'm finding that if I have text entered into a <textarea ...> </textarea> in a form, and that text has leading blank lines (with no spaces or anything else), that when I retrieve the entered...
2
4233
by: \Dandy\ Randy | last post by:
Hello everyone. I have been following misc posts, as well as reading several FAQ's on this issue, unfortunatley I cannot locate a solution. I am hoping that someone will be able to provide me with...
1
12764
by: Joshua Ammann | last post by:
Hello, I'm trying to export a query containing contact information, including a field. Some zip codes have one or two leading zeros, for example, San Juan, PR (00927) and Springfield, MA...
26
4778
by: steve | last post by:
Well I've been working all morning and have finally found the source of my "bus error (signal 10)" errors. The source is odd. The error occurs in any function where I make the function call: ...
1
1053
by: TJS | last post by:
I am populating a dropdownlist control from a query. Each line of content in the dropdownlist may get modified with a leading text character as a flag before being added to the list. how can I...
4
12577
by: Brian Henry | last post by:
Say I have a text string like "0002323235-3434-3545" and I want to remove the leading zeros, would a regular expression work here? sorry I haven't worked with regex's that much and still need to...
2
2808
by: GS | last post by:
How can one avoid capturing leading empty or blank lines? the data I deal with look like this "will be paid on the dates you specified. xyz supplier amount: $100.52 when: September 07,...
6
7734
by: JimmyKoolPantz | last post by:
Task: Customer wants a script of the data that was processed in a "CSV" file. Problem: Zip-Code leading zeros are dropped Basically we have a client that has requested a custom script for...
0
4066
by: Monty | last post by:
Hi All, I am having a problem with leading zeros being stripped from fields in a CSV file when I bring them in using Jet/OleDB. In VB.Net/VS 2008, I am accessing a CSV file like so: sSQL =...
0
7223
marktang
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,...
0
7114
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...
0
7377
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...
0
5623
agi2029
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,...
1
5045
isladogs
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...
0
3191
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...
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.