@jazzurro, you perfectly can do this with R, just look up osmar package! Read the osmar documentation (osmar.r-forge.r-project.org/RJpreprint.pdf). At pages 11 pp. you can find a detailed example for extracting roads/highways by the according tags for munich.osm! After pulling and extracting the data from a planet file for Australia you can convert to any format you wish!
Edit:
As some commentators were complaining about lacking examples I'll post an example from the docs. IMHO it wouldn't be necessary to retype existing examples here, would it?
library(maptools)
library(osmar)
url <- "http://osmar.r-forge.r-project.org/"
file <- "muenchen.osm.gz"
download.file(sprintf("%s%s", url, file), file)
unzip("gzip -d muenchen.osm.gz") # gzip is linux only, on windows I unzipped this manually with 7zip!
src <- osmsource_osmosis(file = "muenchen.osm")
muc_bbox <- center_bbox(11.575278, 48.137222, 3000, 3000)
muc <- get_osm(muc_bbox, src)
muc
summary(muc)
hw_ids <- find(muc, way(tags(k == "highway")))
hw_ids <- find_down(muc, way(hw_ids))
hw <- subset(muc, ids = hw_ids)
plot(muc)
plot_ways(hw, add = TRUE, col = "green")
# convert to spatial object (SpatialLinesDataFrame)
# and save to whatever format you like..
hw_line <- as_sp(hw, "lines")
reading the mapsforge-dev mailinglist for a long time now, I never came accross such a conversion feature.
I assume that OSM data -> mapsforge mapfiles is a oneway processing.
But you can try to ask on your own there,
see https://groups.google.com/forum/#!forum/mapsforge-dev
(I only found one similar question there from 2013, but no answer.)
Best Answer
You can do it with JOSM + OpenData plugin. With this extension JOSM can open SHP (4326) than you can save it as OSM file