Forum Discussion
1 Reply
Sort By
- richieCommunity Hero
Hey nngrjg
I've put something VERY basic together where it'll write 10 values to a flat file in a single column - you didn't say anything about infile presentation or anything like that - im sure the real coders would do something more efficient/better - but without knowing more details - this will do the job of what you asked.
//below script will write 10 values in a single column in the file in a newly created file java.io.File File file = new File("C://Users/Rich/Downloads/groovytest.txt") file.write("valuefrom1stloggedvariable\n") file.append("valuefrom2ndloggedvariable\n") file.append("valuefrom3rdloggedvariable\n") file.append("valuefrom4thloggedvariable\n") file.append("valuefrom5thloggedvariable\n") file.append("valuefrom6thloggedvariable\n") file.append("valuefrom7thloggedvariable\n") file.append("valuefrom8thloggedvariable\n") file.append("valuefrom9thloggedvariable\n") file.append("valuefrom10thloggedvariable\n") //log.info(file.text)
Cheers,
Rich
Related Content
Recent Discussions
- 2 days ago