Jump to content

Report to export student photos and then batch file to rename them to UPN number


Recommended Posts

Posted
I need a report that will export all the student photos and their UPN number, then some how rename all the student photos to their UPN number. I think this is something that will have to be done out of Sims but not even sure it can be done????
Posted

Check our SalamanderSoft Limited - Free Utilities for an extractor thanks to @rpwillis . It usually names them by the SIMS Admission number.

 

It should be fairly trivial to rename to your liking. If you get a report with UPN and Admission number to Excel. I use a program called Bulk Rename Utility Introduction - Bulk Rename Utility , that will let you specify a mapping file, which will be your excel report saved as a text file, and rename in seconds. Failing that i used to use a batch file to do it, but this utility saves the hassle of editing the batch for different answer files.

  • Thanks 3
Posted

in my old job I used to have to rename photo files all the time - I used to use a program called U Rename It to do it when it was a simple thing, but I think if you did this in excel it would be easier - although you would have to know how sims was naming the photos on export.

 

but build a concatenate formula of ren "photo name.jpg" "UPN.jpg" and then copy that to a text file and save it as a bat.

  • Thanks 1
Posted
Check our SalamanderSoft Limited - Free Utilities for an extractor thanks to @rpwillis . It usually names them by the SIMS Admission number

 

I've tried this and can't get it to output anything, does anyone know if its compatible to the latest version of Sims?

Posted
I've tried this and can't get it to output anything, does anyone know if its compatible to the latest version of Sims?

 

I haven't tried it and wasn't going to pipe in here but if you have no luck, I wrote a small tool that may help you

Posted

I can't help you export them but I've used this before - in excel start with a list of the admin no's and UPNs in adjacent cells then use several cells and the concatenate function - & - to build up a formula that follows this pattern rename "12345.jpg" "UPNNUMBER.jpg"

Copy the entire column, paste it into notepad to sanitise it then select all copy into a command prompt which is openned in the route of the photo folder - use CD to navigate to that if you need to.

Posted
I can't help you export them but I've used this before - in excel start with a list of the admin no's and UPNs in adjacent cells then use several cells and the concatenate function - & - to build up a formula that follows this pattern rename "12345.jpg" "UPNNUMBER.jpg"

Copy the entire column, paste it into notepad to sanitise it then select all copy into a command prompt which is openned in the route of the photo folder - use CD to navigate to that if you need to.

 

What @michael2k6 said... I save as text then rename to .bat after making excel do the work, but paste via notepad sounds like a good shortcut.

 

Have you got the photos pre import to sims? If so that might be quicker.

  • Thanks 1
Posted

Another tip if it's going to become a regular thing is create an excel workbook with two sheets, one being a lookup range of all students admin vs UPN.

Then on the other sheet create a lookup based on column A as your admin number, then you've constantly got an uptodate spreadsheet.

To get the correct list of images into column A do a dir in a prompt on the images folder, and paste the results into the column. Once you've saved that template you're looking at run DIR, paste into column A and then paste your results column back out into another prompt and you're done.

The one thing to watch for which will catch you out is that a dos prompt has a limited amount of rows as results before it truncates them top first. So if you're doing DIR on a large amount use powershell. Rename isn't in powershell so you'll have to use powershell for the DIR and cmd for the rename.

Posted

I'm sure I ran the exporter recently and it was fine. I think I was doing staff though.

Did you go through the readme file? you need a local connect.ini and a user with permissions.

 

All the Dos tips and excel are good, I did it for years, but since moving to a utility I will never go back.

 

To make a decent dos list use /w, /b I think for better formatting and also redirect it straight to a text file with a "> list.txt"

 

I now just build my mapping file that the utility requires straight in SQL. I just have all the concatenation in that. You could put your rename code in their if you prefer that. So if you're comfortable running SQL on your DB just run that and save as text file and supply to utility or save as bat and run. In theory the SQL can be scheduled to auto run and output to file which is something i do for updating the library system.

 

Thing is if you get the extractor to work you don't need a dos list you just need a sims report that gives both columns out to a file, if it a csv then a two line batch script will rename using the for command and you won't need to mess with concatenation. I've posted my rename script on here somewhere before

  • 5 months later...
Posted

done this recently for our new allpay install in the dining room. It all worked as described by @vikpaw except bulk rename utility which i took one look at and then decided I didn't have time to figure out that crazy program. Also the site itself was incredibly slow.

I wrote my own vbs script in 30mins.

 

 

 

Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim fso, f, ts,strpath

strpath="d:\test"

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile("upns.csv")
Set FLD = FSO.GetFolder(strPath)

 
Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault)
  
Do While ts.AtEndOfStream <> True
TextStreamTest = split(ts.ReadLine,",")
adno=textstreamtest(0)
upn=textstreamtest(1)

For Each fil in FLD.Files

	strOldNamearray = split(fil.Path,"\")
	fname = strOldNamearray(2)
	matchname = adno & ".jpg"
	newname = strpath & "\" & upn & ".jpg"
	
	if fname = matchname then fso.movefile fil.path, newname
next


loop

f.close
set fso = nothing
set fld = nothing

Posted

I could have shown you how to use the program quicker than that! In place of the csv it just needs a list with | on each line.

It's got so many other really useful features like it can undo what you just did. slightly modify the output, whack on headers, change the file extension etc.

I frequently use it to copy and rename, so it doesn't alter the originals, but pushes them where i need them. Then i can run the whole thing again with a different mapping file which is required by another system. Undo is the coolest feature though.

Posted

I wrote a small program a while back that pulls the photos out of SIMS and saves them as either name, UPN, ID or admission number. It can also add the name in a small box below the photo if you want (as part of the final image) and resize on the fly...

 

If anyone is interested, I'll knock together some documentation for it (thought it's very simple, just a couple of arguments on the command line - I could put a simple GUI together if people would prefer)

  • 1 year later...
Posted (edited)
I wrote a small program a while back that pulls the photos out of SIMS and saves them as either name, UPN, ID or admission number. It can also add the name in a small box below the photo if you want (as part of the final image) and resize on the fly...

 

If anyone is interested, I'll knock together some documentation for it (thought it's very simple, just a couple of arguments on the command line - I could put a simple GUI together if people would prefer)

i am a teacher who has been getting more involved in the IT side since more and more reliance has been made on iPads and idoceo and emerge.

 

I am struggling with one particular task, exporting sims photos (I used photoexport, exporting all into years which exported as admission ID) I really need them as UPN number. That was until I read this message from you

 

"I wrote a small program a while back that pulls the photos out of SIMS and saves them as either name, UPN, ID or admission number. It can also add the name in a small box below the photo if you want (as part of the final image) and resize on the fly..."

 

I was wandering if your tool/app is still able to do that from sims? I apologise but I am not too technical, and from what I have read a csv might be needed if I can not pull the pictures and rename auto from extraction which is highly preferred:)

 

I mean if UPN was a problem then of course even extracting and renaming as name (surname, forename) would be great.

 

Many thanks, and hoping this is not to trivial a request

Edited by Bothered
Posted

@Bothered the tool here will get you them out using the admission number SalamanderSoft Limited - Free Utilities but i think you've got that bit cracked.

 

If you then just need to rename them, the utility mentioned earlier will do the trick. It's very quick.

 

You can generate the csv from SIMS. Just one word of caution - why does it have to be by UPN? There are rules about using UPN. Where are the pictures going, or what is the purpose?

 

The photoexporter utility from Salamander has a /nameAsId option which will name the files using the internal SIMS database ID - could you use that instead?

  • Thanks 1
Posted (edited)

Cheers for getting back, Yeah I did use that salamander tool, and exported by year easily enough. I am not too fussed about using UPN, it's just that, that is the only definable ID when I export my marksheets from my subject classes, I then want to link my pupil pics for seating plans

 

I really dont mind the pics being instead renamed on export to [sURNAME, name] as seen in registers on SIMS. (this is what losojos tool seems to suggest to do during export of pics) I would deffo do that instead if UPN rules are stringent. I'd rather the easiest yet least issues/hassle route for sure. However I would just use the UPN to match and then delete the UPN once the pics are matched.

 

Another route is if I could export my marksheet and it contains the admission ID instead of the UPN in column A. I would use that in an instant (as then the pics are already named by admission ID so easy to match, but I fear that is another several steps of which I have no idea how to do.

 

I have actually been using bulk rename utulities for some time, but that was for previous hobbies/modding pro evo for ps3 lol but additionally I have never exported a .csv from sims or neither used a csv in Bulkrenamer. So let's say for admins/guidelines sake, we ignore UPN. I should export as [sURNAME, forename] as seen in sims, that will be fine i'm sure. Hopefully losojos can help with his 'tool'

 

In short after reading, perhaps exporting and renaming as [sURNAME, forename] (like the format seen when doing registers in SIMS, would be best or [sURNAME, forename_ADMINSSION ID] to avoid duplicates

 

Pictures wil not be published publicly anywhere and the aim is for school internal admin/teaching purposes only

Edited by Bothered
Posted

As a marksheet viewer you can right click on the header of the Name column and add additional fields. Admission Number should be one of them.

You can also add that column in the marksheet template, there is a section when adding columns for "Additional Info columns" or something like that.

This will then allow you to export photos by AdNo and match it to the marksheet. Should resolve your issue. :)

  • Thanks 1
Posted
If your suggestion works it would be perfect! didnt have much time and dont bring my laptop home (don't worry guys it's put away in a lockable draw/desk) also got a busy off timetable day or two, but will try get back to you by the end of the week :) thanks kindly for all your input
Posted
That bit of info was perfect for my needs !!!! (right click add extra field etc) ta very much :) I'm gonna be learning quite a bit I reckon, cheers

Great news. Now to make life easier, on any future marksheet template, put it into the definition by adding it as an Additional Info Column. This way it will be on all marksheets for that template, and available to all viewers without needing to right click, add col etc. It's worth the time putting that in as well as any other columns that staff may find useful e.g. gender, dob, just bear in mind it takes up space and probably load time.

 

You should also explore, if you haven't already, the bulk routines under Tools | Performance | Assessment | System Utilities

Be wary of delete, but export marksheets could be useful depending on your purpose and required output.

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...