[GIS] How to save several asc files to geotiff

convertexportgeotiff-tiffqgis

In QGIS (2.18), I have several raster files (.asc-format) that have no projection information.
The images display well at EPSG:5677. My aim is to store all the files in a new folder, using the GeoTIFF format and assigning EPSG:5677.

I have no python experience, however some python coding could help me here, I guess. I read something similar but shapefile-related here:
Exporting several files at same time in QGIS?

Of course, this doesn't work with my raster files. So here goes my question: how can I export a bunch of raster files, using the original file names and assigning the desired coordinate reference system without having to export every single file manually?

Best Answer

Based on the User's comment that they would be open to trying this in R, here's the solution:

#Load the three packages below 
library(sp)
library(raster)
library(rgdal)

#List the files that you want to export from the source folder
files <- list.files(path="C:\\Users\\.", pattern="asc$", full.names=TRUE) #selects all the asc files in the directory
s <- stack(files) # stack all of them using r raster library
proj4string(s) <- CRS("+init=epsg:5677") #Sets it to the projection you wanted
newname<-paste("C:\\Users\\",names(s)) #Saves the previous names
writeRaster(s,newname, bylayer=T, format="GTiff")#Edited based on Fumy's comment    
Related Question