I have a shapefile of line data (roads) and one of point (villages) data. In an ideal situation all the points should be connected to a line. The data that I have doesn't obey this. I need to join all the points to the nearest line using a straight line. What function can I use in ArcGIS to obtain this. I need this data to carry out the Closest Facility solver in Network Analyst in ArcGIS.
Network Analyst will automatically snap points (incidents or facilities) to the nearest network edge when you add them if configured to do so; there's no need to do so beforehand.
If you want to force it, Snap could be used (requires Standard or Advanced license, directly modifies data so run it on a copy).
If you actually want to draw a new line to represent a network edge straight from the point to the nearest existing network edge, you might take a look at Arcgis 10: Point layer, polygon line layer, draw points to the nearest polygon point or other nearest line? Depending on how far your points might be from the network, this might be a good idea or required as I'm pretty sure the distances in the solver result will only be along the network, and not include the 'snapping' distance.