Jan 24 2007, 11:01 AM
I have a CSV file that has a large number of lines, one element in each is a full IP address (eg 184.108.40.206). I want to import this data in to an access table but I only need the first two sets of numbers of the IP address. I don't want to have to manually edit each record - so is it therefore possible to create a validation rule to remove the bits I don't want at the time of the import or is there a way to triming the data afterwards.
Any answers would be much appreciated.
Regards - Nomad9
Jan 24 2007, 11:06 AM
I *think* this will work:
Left("220.127.116.11", InStr(InStr("18.104.22.168", ".") + 1, "22.214.171.124", ".") - 1)
Just replace all the 123's along with their quotes with your fieldname.
Jan 24 2007, 11:19 AM
Thanks for the quick response but when replacing the "126.96.36.199" with the field name IP the rule is not acceptable, saying it is too complicated and it should be simplified with variables. It also inserts quotes around the field name again!
Cheers - Nomad9
Jan 24 2007, 11:25 AM
You probably have to manually add the square brackets...
Left([YourFieldName], InStr(InStr([YourFieldName], ".") + 1, [YourFieldName], ".") - 1)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here