473,378 Members | 1,679 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,378 software developers and data experts.

vb script - replace and hex

Hi.
I'm extracting dates from a file and I've found something that seems very inconsistent.

I print to the console when I find what I am looking for. Then I attempt to split the value I found. The first example processes without incident.

19 Mai 2006

After a few more successful finds I hit this:

1 mars 2006

Then when I try and split it by space and call the split_value(2) its out of bounds, and upon further investigation I see that split_value(0) is 1 mars 2006

I also print the values to a log file. When I copy and paste them into notepad++ and covert them to hex, this is what I get:

31 39 20 6D 61 69 20 32 - 30 30 36 20

and

31 A0 6D 61 72 73 A0 - 32 30 30 35 20

The most obvious thing is the difference in space characters.

This was for work and it appears I might have written something down wrong. Anyway if you have any suggestions as to how I can work around this I'd love to hear them.

Thanks!
Aug 8 '08 #1
1 4290
kadghar
1,295 Expert 1GB
yeap, what you say is right, the ASCII code for [space] is 32
but in the 2nd one, you're using 160 (A0 in hex)

so if you see, this will give you twice the same result:

Expand|Select|Wrap|Line Numbers
  1. Sub SpaceTest()
  2.     MsgBox "a" & Chr(32) & "a"
  3.     MsgBox "a" & Chr(160) & "a"
  4. End Sub
Replace before parsing the string seems like a good solution:

Expand|Select|Wrap|Line Numbers
  1. replace(str1, chr(160), chr(32))
  2. split_array = split(str1,chr(32))
HTH
Aug 8 '08 #2

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

Similar topics

12
by: hokiegal99 | last post by:
Is there a forum where one could post a Python script and have it critiqued by others? Something like: Y would be more efficent if you did it this way, or doing it that way could cause problems...
1
by: Les Juby | last post by:
A year or two back I needed a search script to scan thru HTML files on a client site. Usual sorta thing. A quick search turned up a neat script that provided great search results. It was fast,...
4
by: Derek | last post by:
I have the following script in a page and it gets an error in IE 6. Says something about an invalid argument but the line number doesn't help since I can't see the javascript code when viewing...
4
by: Wm | last post by:
I have a script that changes a main/enlarged image when you click on a thumbnail. It works fine in IE, but for some reason it won't do anything in Netscape 7.1. Does anyone know if this is a...
11
by: tlyczko | last post by:
Hello Rob B posted this wonderful code in another thread, http://groups.google.com/group/comp.lang.javascript/browse_thread/thread/c84d8538025980dd/6ead9d5e61be85f0#6ead9d5e61be85f0 I could not...
1
by: Jose Reckoner | last post by:
I'm running python 2.3 on Windows XP. Anyone have a quick small script to convert .DT1 and .DEM data to ASCII or some other format? I don't need a viewer. Thanks!
1
by: dragze | last post by:
Hi, On one of the pages of my site i use two javascripts, one makes transparency of png's work in IE, and the other embeds a flash player. Now use one of the scripts it works fine, use both and...
7
by: ojsimon | last post by:
Hi I found this script on a forum and have been trying to make it work, but all it returns is a blank screen, i tried using the debug error reporting but got nothing from that either just a blank...
12
by: Phillip B Oldham | last post by:
I'm keen on learning python, with a heavy lean on doing things the "pythonic" way, so threw the following script together in a few hours as a first-attempt in programming python. I'd like the...
3
by: jeddiki | last post by:
Hi, I am using this script which is nearly working correctly, but not quite! When a user selects some text from the web-page and copies it, the script is supposed to pick up the current...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.