Search found 5 matches
- 08 Oct 2017, 19:41
- Forum: Help and Support
- Topic: Renaming file base on JSON list?
- Replies: 6
- Views: 15245
Re: Renaming file base on JSON list?
{ def inputFile = new File("F:/MEGA/SC MOVIES/1.json") def json = new groovy.json.JsonSlurper().parseText(inputFile.text) def scid = fn def name = json.find{ it.scid == scid }.title def year = json.find{ it.scid == scid }.year def rename = name + ' - ' + year } I'm new to Groovy so it mig...
- 08 Oct 2017, 07:42
- Forum: Help and Support
- Topic: Renaming file base on JSON list?
- Replies: 6
- Views: 15245
Re: Renaming file base on JSON list?
e.g. { def json = new groovy.json.JsonSlurper().parseText('''[{"title":"The Little Hours","year":"2017","imdbid":"tt5666304","scid":"10080"}]''') def scid = fn // e.g. 10080.mp4 json.find{ it.scid == scid }.title } Now ...
- 07 Oct 2017, 08:09
- Forum: Help and Support
- Topic: POSTBUCKET - where random posts in unrelated topics go
- Replies: 1003
- Views: 595682
Re: Batch Rename any type of file
Well, I wanted to try it in XML since I wanted to use your example, but not coming up with anything. def fnn = fn xml = new XmlSlurper().parse(folder+'/mov.xml') xml.'**'.find { it.name() == 'scid' && it.text() == fnn}*.parent()*.title*.text() that should return the title but it's not workin...
- 06 Oct 2017, 21:22
- Forum: Help and Support
- Topic: POSTBUCKET - where random posts in unrelated topics go
- Replies: 1003
- Views: 595682
Re: Batch Rename any type of file
Thanks!. I tested it out using the example and it worked fine. However, when I use it with my XML file (I converted the JSON > XML), it says my format is not correct.
I use the same format and code as the example
I use the same format and code as the example
- 06 Oct 2017, 06:22
- Forum: Help and Support
- Topic: Renaming file base on JSON list?
- Replies: 6
- Views: 15245
Renaming file base on JSON list?
Is there a way to rename files based on a JSON list? For example I have something like this : [{"title":"The Little Hours","year":"2017","imdbid":"tt5666304","scid":"10080"},{"title":"CarGo","yea...