If your field type is a string that contains data formatted exactly as you said, then filling your new field is a relatively simple matter of parsing out the string.
Since you did not specify, I'll give options in both the ArcGIS, and Quantum GIS software packages, depending on what you are using.
In this case, the
Left function would be appropriate, in which you specify the source text, and then the number of characters that you want to use from the left of the source.
Right click on the name of your new field, and choose "Field Calculator". Type in what you see from the screenshot below. Replace
[CONST_DATE] with your column name. This is a VB Script option. It looks like a Python style answer has also been posted.
- Toggle Editing Mode to On -
- Open Attribute Table
- Open Field Calculator
- In this case, the appropriate function is
substr. In this function, you choose the
source text, then specify the
starting point, and the
length that you want to capture. This uses an index where the first position in the string is
- Enter text into Field Calculator box as in the screenshot below. Again, replace the field name
CONST_DATE, with your appropriate source column. Also, on the right, choose the appropriate column that you are filling the date into.
- Save Edits -
- Toggle Editing Mode Off -