shrug-l: Split a column in attribute table

Mayo, Michele L. Michele.Mayo at dep.state.fl.us
Fri Oct 6 15:03:39 EDT 2006


 

I think Lance's suggestion will work, except, possibly, for the TIME column.
If that value may be variable length (eg '8 AM') then you may get better
results with this...

 

Right( [oldfield] ,(Len( [oldfield]) -Instr( [oldfield] ," ")))

 

Note that the space character between the double quotes is important.

 

If all of your time values are in a five character format (eg '08 AM') then
Lance's expression should work just fine.

 

Michele

 

 

  _____  

From: shrug-l-bounces at lists.dep.state.fl.us
[mailto:shrug-l-bounces at lists.dep.state.fl.us] On Behalf Of
lance.peterson at dot.state.fl.us
Sent: Friday, October 06, 2006 2:40 PM
To: Shrug List
Subject: Re: shrug-l: Split a column in attribute table

 


For me, the easiest way to do this will be to add a Year, Month, Date and
Time column to the shapefile database in ArcCatalog. Do this by displaying
the table in the Preview tab and then use the Options dropdown to "Add
Field". I would add the columns as a String data type. 

Then open the shapefile in ArcMap and in the Editor Toolbar select Start
Editing. Right click the layer and select Open Attribute Table. In the Table
Window, use Options to Select All. 

Then right click on a column you added, i.e. Year, and select Calculate
Values. You can use a string function to parse the data in your first column.
For example: 

Year = Mid( [SingleColumn], 1,4) 
Month = Mid( [SingleColumn], 5, 2) 

For the Time you may want to try = Right(  [SingleColumn], 5) 

You may have to play with the beginning and ending column values to parse the
data correctly. 

You can search for "tables, editing" in ArcGIS help, Index tab, for more
information on editing tables. 

I'd be willing to bet that there are a couple of other ways to do this. 


Lance Peterson
Peterson Consulting / FL Dept. of Transportation
Business Systems Support Office
Office of Information Systems
Phone: 850-410-5545




Gary Watry <watry at steam.coaps.fsu.edu> 
Sent by: shrug-l-bounces at lists.dep.state.fl.us 

10/06/2006 01:50 PM 

Please respond to
watry at coaps.fsu.edu

To

Shrug List <shrug-l at lists.dep.state.fl.us> 

cc

 

Subject

shrug-l: Split a column in attribute table

 

 

 




Is there a way to split a column in a shapefile attribute column into 
several columns
i.e.
20060401   11 AM

into

2006 | 04 |  01 | 11 AM |

-- 
Gary L. Watry
GIS Coordinator
Center for Ocean-Atmospheric Prediction Studies
FSU / COAPS
Johnson Building, RM 215
2035 East Paul Dirac Drive
Tallahassee, Florida 32306-2840

Phone (850) 645-7457

E-Mail: watry at coaps.fsu.edu




_______________________________________________
SHRUG-L mailing list
SHRUG-L at lists.dep.state.fl.us
http://lists.dep.state.fl.us/mailman/listinfo/shrug-l

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.dep.state.fl.us/pipermail/shrug-l/attachments/20061006/fda01208/attachment.html


More information about the SHRUG-L mailing list