I converted XY values to the points, however when I tried to generate the Object-ID to the same shapefile using Add field tool, the tool didn't work, popping out with a message that table is not editable. can anybody help me to come out of this problem?
The FID field can't be edited or modified. If you want to add a new field, you can add one as and integer field, then simply calculate values for it using the field calculator (ie newfield = FID or similar)
Sir I want to generate FID to shapefile automatically while plotting it from .csv. FID can be generated as per your answer and also once we plot it from table and export it then automatically FID will be generated. I want to generate it while plotting.
Can you elaborate on "while plotting it from .csv."
If you are plotting x,y coordinates from a CSV file, have you looked at Make XY Event Layer? The Make XY Event Layer tool won't generate an FID/OID, but it does convert your x,y coordinates into a valid layer in ArcMap.
Why do you need an FID/OID dynamically created? What are you trying to do that is prevented from not having that field?
You are close to clarify my doubt, I know that we can use Make XY Even Layer to plot our coordinates from csv/xlxs files, but what I want is FID/OID must be created dynamically while plotting the coordinates.
I am still interested in why you need to have an FID/OID field with your event layer(s)? What are you trying to do with your event layer(s) that can't be done without an FID/OID field present?
You mention "csv/xlxs files." I would argue that CSV and XLS/XLSX files are different enough, and thus handled differently enough by ArcGIS Desktop, that what works for one might not work for the other.
I am not recommending the following, but there is an option for CSV/text files using the Make Query Table tool. The Make Query Table tool supports OLE DB connections, which means you can work with CSV/text files if your machine's data drivers/sources are setup correctly. The reason I mention the Make Query Table tool is that it can dynamically create an OID field.
General steps:
I believe the query table can be removed afterwards and the event layer is still valid. I haven't tried scripting the steps above, but it seems like it should be possible. The biggest hassle, by far, will be managing the OLE DB connections to lots of CSV/text files.
Joshua I know this method. I'm just trying to explore the other way but couldn't get the answer. thanks for you prompt reply.
As Joshua says, make your event layer, then save it out to a shapefile and the FID will be created, or make it in a geodatabase and you will get the same thing but it is called OBJECTID. If the problem is that you want stuff in a different order than would be generated... do the reordering before bringing it. Once, created the FID remains as long as the feature exists. IDs only get regenerated when edits are done and saved.