Jump to content

FrankPottner

Newbies
  • Posts

    3
  • Joined

  • Last visited

FrankPottner's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

1

Community Answers

  1. Thanks "enthusiast with a bit of geek"... that almost worked. I just had to add the UTF8 encoding to the "myInFile.eachLine" command also. The script now looks like the following and does exactly what I need; myInFile = new File( myFilePathStart ) myOutFile = new File( myFilePathEnd ) try{ myOutFile.withWriter('UTF-8') { out -> myInFile.eachLine('UTF-8') { line -> myOutFileText = line.replaceAll(""", "''") .replaceAll("“", "''") .replaceAll("”", "''") + "n" out << myOutFileText; } //end eachLine } //end writer } catch (e) { return e } return true
  2. Hi, I'm completely new to Groovy and am trying to replace the 3 versions of the double quotes with 2 single quotes in a large CSV file. I've managed to get the script below working but the input file encoding is UTF8 and the output file comes out as "Western (Mac OS Roman)". Any help would be greatly appreciated, Thanks File myInFile = new File( myFilePathStart ); myOutFile = new File( myFilePathEnd ); myOutFile.withWriter { out -> myInFile.eachLine { line -> myOutFileText = line.replaceAll(""", "''"); myOutFileText = myOutFileText.replaceAll("“", "''"); myOutFileText = myOutFileText.replaceAll("”", "''"); myOutFileText = myOutFileText + "n"; out << myOutFileText; } }; return true;
  3. I'm sure this is a very simple question; I just haven't found the answer. Once I have the path to a file, how do I use ScriptMaster to open the file with it's native app?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.