472,374 Members | 1,488 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 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 2058
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.