473,397 Members | 2,099 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,397 software developers and data experts.

Not able to remove blank spaces from string

I'm implementing a feature which reads comma separated txt file from server(one line at a time).

Format of file is fixed, There are 3 columns on each row.

After reading the row from file I insert it in a database table.

But first value of each row aoutomatically appends two blank spaces, even if there are no blank spaces at the begining of each row.

I tried to use "TRIM/LTRIM/Replace" to remove blank spece from the first value of each row, but didn't succeed.

I even tried to use trim in stored procedure itself.

Can you please provide me a work around to remove blank spaces in this scenario.

Thanks in advance
Aug 16 '10 #1
2 2151
Joseph Martell
198 Expert 128KB
Check how you are using your Trim function. The Trim function does not modify the string you call it on. For example:

Expand|Select|Wrap|Line Numbers
  1. Dim aString As String = "   Example of String  _   "
  2. aString.Trim()    'does not modify value of aString
  3.  
In order to get the Trim to stick, you have to assign the result of the Trim() operation:

Expand|Select|Wrap|Line Numbers
  1. aString = aString.Trim()
If this doesn't work, post your code as you are currently using it so we can see exactly what isn't working.
Aug 17 '10 #2
Dear Joseph,

Thanks for your reply.

I solved it, Actually, I was using VbCrlf after each row, this was causing the issue, I have removed VbCrlf and I am not having blank spaces after each row.

Thanks again.

Swapnil
Sep 1 '10 #3

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

Similar topics

9
by: Jean-Marc Molina | last post by:
Hello, I can't find a way to execute a Windows application, whose directory path contains blank spaces, from a PHP script. I also wonder if the problem happens under Linux and other OS. ...
1
by: Danny | last post by:
Given this: "*" the pattern to remove the htnl code between brackets, how can I remove a series of spaces and just make one space. like here is a series of blank...
1
by: macupryk | last post by:
-- _list Count = 13 System.Collections.ArrayList + {QUEST} object {System.Data.DataColumn} + {S_DAT} object {System.Data.DataColumn} + ...
3
kamill
by: kamill | last post by:
how can i remove blank spaces from text file......is there any function to remove a perticular chr from file...
3
by: metalinc | last post by:
hi! i need help in C programming to TRIM BEGINNING and END BLANK spaces in STRING.....
3
by: ShaeMills via AccessMonster.com | last post by:
In my table I imported from .txt, one of my columns has blank spaces. The column is as follows, how do I eliminate the blank spaces in between the second and third, and fifth and sixth digits? ...
1
by: maryanncanor | last post by:
Hi everyone, My problem is whenever I export a report to a textfile. The output textfile have blank spaces. Here is my query: SELECT ( & '|' & & '|'...
2
by: Marvstyles | last post by:
How would i check a string for blank spaces and if there is more than one blank space between two words, how would i convert it into just one blank space between the words? Another question i...
1
KeredDrahcir
by: KeredDrahcir | last post by:
I have some values in an array and I need to remove the blank spaces before them. I've used array_walk($context_array, 'trim_value');To trim the spaces using the function: function...
9
by: madhuriks | last post by:
hi, i tried to delete an element in xml..for that i used servlet coding...it is getting deleted but blank spaces are remaining i dont want that blank spaces..can any one do me needfull..here is my...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...
0
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...

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.