Wednesday, October 4, 2017

Recipe: Populating a column with sequential call numbers

You can actually fill a column in Open Refine with sequential call numbers. All you have to do is take advantage of the fact that row.index returns an integer.

Our local accession numbers for video games are GVD<number>, so if I wanted to populate a spreadsheet with :

GVD1100
GVD1101
GVD1102
GVD1103
etc.

You'd do : "GVD" + (row.index + 1100)
or
"<prefix>" + (row.index + <starting call number>) 

 

row.index for the first cell starts at 0 and then increments by one for each cell. All I have to do to get it to populate my call numbers is to add row.index to the first call number:
















However, since row.index + 1100 is an arithmetic operation, you can't do
"GVD" + row.index + 1100, because you'll get this:
















To isolate the two, put parentheses around row.index + 1100.

No comments: