Skip to main content
Question

Rename file extension after translation

  • April 24, 2018
  • 8 replies
  • 40 views

Forum|alt.badge.img

I have a Workspace that generates a .jpeg file with a named coordinate file. wld. Is there no way to generate the .jgw file or rename it to .jgw after translation?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

8 replies

erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • April 24, 2018

Use the FeatureWriter transformer instead of the JPEG writer and follow the Summary port by a SystemCaller transformer to rename the file.


Forum|alt.badge.img
  • Author
  • 10 replies
  • April 24, 2018

Use the FeatureWriter transformer instead of the JPEG writer and follow the Summary port by a SystemCaller transformer to rename the file.

@erik_jan, helped me a lot. This is way. But the systemcaller don't work properly. I use this command: C:\\Users\\Usuario\\Desktop\\teste /ren *.wld *.jgw, but nothing happens.

 


erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • April 24, 2018

Try this command line:

ren C:\\Users\\Usuario\\Desktop\\teste\\*.wld *.jgw


erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • April 24, 2018

Try this command line:

ren C:\\Users\\Usuario\\Desktop\\teste\\*.wld *.jgw

This is the help for the DOS RENAME command:

 

ren /?

 

Renames a file or files.RENAME [drive:][path]filename1 filename2.REN [drive:][path]filename1 filename2.Note that you cannot specify a new drive or path for your destination file.

 


david_r
Celebrity
  • 8394 replies
  • April 25, 2018

If you need to rename a file using the SystemCaller, pass the whole thing below as the command line:

c:\windows\system32\cmd.exe /c "ren c:\temp\source_file.txt destination_file.txt"

You cannot use the "ren" command directly since it isn't an executable by itself, only a function defined inside the command line shell. This is not a limitation of FME, it's just how Windows is :-)


erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • April 25, 2018

If you need to rename a file using the SystemCaller, pass the whole thing below as the command line:

c:\windows\system32\cmd.exe /c "ren c:\temp\source_file.txt destination_file.txt"

You cannot use the "ren" command directly since it isn't an executable by itself, only a function defined inside the command line shell. This is not a limitation of FME, it's just how Windows is :-)

Thanks @david_r, I did not know that.

 

Or create a batch file with this command line and call the batch file. In that case you do not need to call the cmd.exe

 


david_r
Celebrity
  • 8394 replies
  • April 25, 2018
Thanks @david_r, I did not know that.

 

Or create a batch file with this command line and call the batch file. In that case you do not need to call the cmd.exe

 

Agree, that's also a good solution.

 


Forum|alt.badge.img
  • Author
  • 10 replies
  • April 25, 2018

Thank you all, solved my problem.