cancel
Showing results for 
Search instead for 
Did you mean: 

Groovy Script for reading prefix value of the xml file name

Highlighted
Contributor

Groovy Script for reading prefix value of the xml file name

I have done a script for taking xml files from local machine. It's working good but I need a script for taking only prefix/suffix of the file name. this is my script.

 

Can You please help me on this..

def soNumber  = holder.getNodeValue("//*:employees/*:employee/*:id")//

def file = new File (groovyUtils.projectPath+"/${soNumber}.xml")//
log.info(file)
def fileToLoad = '888888'// default file name is 888888
if(file.exists())
{
  fileToLoad   = soNumber
}

1 REPLY 1
Moderator

Re: Groovy Script for reading prefix value of the xml file name

Hi Priyanka,

 

Can you please clarify your request and provide us with some example?

 


Anastasia
Customer Care Team


Join September Hub-bub to show off, learn and win

New Here?
Join us and watch the welcome video:
Watch the New Interview
7Mistakes
Join the exciting event
SeptemberHubBub
Join the September Hub-bub to show off, learn and win