Skip to main content
Question

Rename file extension after translation


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?

8 replies

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • 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
erik_jan wrote:

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+18
  • Contributor
  • April 24, 2018

Try this command line:

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


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • April 24, 2018
erik_jan wrote:

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
  • 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+18
  • Contributor
  • April 25, 2018
david_r wrote:

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
  • April 25, 2018
erik_jan wrote:
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

Thank you all, solved my problem.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings