Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Split a string by carriage return 2

Status
Not open for further replies.

mbro

Programmer
Nov 12, 2004
25
0
0
US
Hi,

I'm reading in a file a line at a time, and am running into difficulties splitting it into its components. I'm pretty sure it's delimited by carriage returns (Enter) but the couple ways I've tried to split it don't seem to work.

The delimiter when the file is opened in notepad is a square.

Does anyone know the method I can split this string into its pieces?

Thanks,
Mike
 
There are several such methods you can use, but you need to be sure of the delimiter first (square in notepad is a placeholder). Once this is identified I am sure someone will have your answer.

Good Luck,

Alex

A wise man once said
"The only thing normal about database guys is their tables".
 
Yeah... what he said. [smile]

Do this...

1. Open the file in Notepad.
2. Open VB
3. Highlight the 'square box' in notepad and then CTRL-C
4. In the immediate window of VB, type...
? Asc("[!]CTRL-V[/!]")
5. Press enter.

If you don't see the immediate window, press CTRL-G.

Of course, don't actually type CTRL-V, but paste from your notepad document. When you hit enter, you will see the ASCII value of the 'square box'.

From here, the rest is simple using the split function. After doing this, let me know if you need further assistance.



-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
George-

This must be your day for cleaning up my messes ;-)

Thanks for that little trick, would have saved me a LOT of hassles in the past. You the man!

Alex

A wise man once said
"The only thing normal about database guys is their tables".
 
Thanks,

Worked nicely.

Cheers,
Mike
 
That is a nice trick, George. Star for you! Thanks for sharing it. Oh, and by the way, there's a post I put in the C# column that might really be a SQL admin question. Perhaps you could take a look at it? The thread is thread732-1301345.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top