Index: src/org/openstreetmap/josm/actions/OpenAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/OpenAction.java	(revision 37)
+++ src/org/openstreetmap/josm/actions/OpenAction.java	(revision 38)
@@ -8,5 +8,7 @@
 import java.io.FileReader;
 import java.io.IOException;
+import java.io.Reader;
 import java.util.Collection;
+import java.util.LinkedList;
 
 import javax.swing.Box;
@@ -29,4 +31,5 @@
 import org.openstreetmap.josm.io.GpxReader;
 import org.openstreetmap.josm.io.OsmReader;
+import org.openstreetmap.josm.io.RawCsvReader;
 import org.openstreetmap.josm.io.RawGpsReader;
 
@@ -55,15 +58,8 @@
 		JCheckBox rawGps = new JCheckBox("Raw GPS data", true);
 		rawGps.setToolTipText("Check this, if the data were obtained from a gps device.");
-		JCheckBox newLayer = new JCheckBox("As Layer", true); 
-		newLayer.setToolTipText("Open as a new layer or replace all current layers.");
-		if (Main.main.getMapFrame() == null) {
-			newLayer.setEnabled(false);
-			newLayer.setSelected(false);
-		}
 		
 		JPanel p = new JPanel(new GridBagLayout());
 		p.add(new JLabel("Options"), GBC.eop());
 		p.add(rawGps, GBC.eol());
-		p.add(newLayer, GBC.eol());
 		p.add(Box.createVerticalGlue(), GBC.eol().fill());
 		fc.setAccessory(p);
@@ -71,5 +67,5 @@
 		if (fc.showOpenDialog(Main.main) != JFileChooser.APPROVE_OPTION)
 			return;
-		
+
 		File filename = fc.getSelectedFile();
 		if (filename == null)
@@ -78,15 +74,38 @@
 		try {
 			Layer layer;
+			Reader in = new FileReader(filename);
+			String extension = filename.getName().toLowerCase().substring(filename.getName().lastIndexOf('.')+1);
 			if (rawGps.isSelected()) {
-				Collection<Collection<GeoPoint>> data = new RawGpsReader(new FileReader(filename)).parse();
+				Collection<Collection<GeoPoint>> data;
+				if (extension.equals("gpx"))
+					data = new RawGpsReader(in).parse();
+				else if (extension.equals("xml") || extension.equals("osm")) {
+					JOptionPane.showMessageDialog(Main.main, "Osm server data import for GPS data is not supported.");
+					return;
+				} else if (extension.equals("csv") || extension.equals("txt")) {
+					data = new LinkedList<Collection<GeoPoint>>();
+					data.add(new RawCsvReader(in).parse());
+				} else {
+					JOptionPane.showMessageDialog(Main.main, "Unknown file extension: "+extension);
+					return;
+				}
 				layer = new RawGpsDataLayer(data, filename.getName());
 			} else {
-				DataSet dataSet = filename.getName().toLowerCase().endsWith(".gpx") ?
-						new GpxReader(new FileReader(filename)).parse() :
-						new OsmReader(new FileReader(filename)).parse();
+				DataSet dataSet;
+				if (extension.equals("gpx"))
+					dataSet = new GpxReader(in).parse();
+				else if (extension.equals("xml") || extension.equals("osm"))
+					dataSet = new OsmReader(in).parse();
+				else if (extension.equals("csv") || extension.equals("txt")) {
+					JOptionPane.showMessageDialog(Main.main, "CSV Data import for non-GPS data is not implemented yet.");
+					return;
+				} else {
+					JOptionPane.showMessageDialog(Main.main, "Unknown file extension: "+extension);
+					return;
+				}
 				layer = new OsmDataLayer(dataSet, filename.getName());
 			}
 			
-			if (Main.main.getMapFrame() == null || !newLayer.isSelected())
+			if (Main.main.getMapFrame() == null)
 				Main.main.setMapFrame(filename.getName(), new MapFrame(layer));
 			else
Index: src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- src/org/openstreetmap/josm/data/Preferences.java	(revision 37)
+++ src/org/openstreetmap/josm/data/Preferences.java	(revision 38)
@@ -65,4 +65,12 @@
 	 */
 	public String osmDataPassword = null;
+	/**
+	 * The csv input style string or <code>null</code> for auto. The style is a
+	 * comma seperated list of identifiers as specified in the tooltip help text
+	 * of csvImportString in PreferenceDialog.
+	 * 
+	 * @see org.openstreetmap.josm.gui.PreferenceDialog#csvImportString
+	 */
+	public String csvImportString = null;
 
 	/**
@@ -129,4 +137,5 @@
 				osmDataUsername = osmServer.getChildText("username");
 				osmDataPassword = osmServer.getChildText("password");
+				csvImportString = osmServer.getChildText("csvImportString");
 			}
 			drawRawGpsLines = root.getChild("drawRawGpsLines") != null;
@@ -158,4 +167,5 @@
 		osmServer.getChildren().add(new Element("username").setText(osmDataUsername));
 		osmServer.getChildren().add(new Element("password").setText(osmDataPassword));
+		osmServer.getChildren().add(new Element("csvImportString").setText(csvImportString));
 		children.add(osmServer);
 
Index: src/org/openstreetmap/josm/gui/PreferenceDialog.java
===================================================================
--- src/org/openstreetmap/josm/gui/PreferenceDialog.java	(revision 37)
+++ src/org/openstreetmap/josm/gui/PreferenceDialog.java	(revision 38)
@@ -59,4 +59,5 @@
 			if (Main.pref.osmDataPassword == "")
 				Main.pref.osmDataPassword = null;
+			Main.pref.csvImportString = csvImportString.getText();
 			Main.pref.setDrawRawGpsLines(drawRawGpsLines.isSelected());
 			Main.pref.setForceRawGpsLines(forceRawGpsLines.isSelected());
@@ -116,4 +117,9 @@
 	 */
 	JPasswordField osmDataPassword = new JPasswordField(20);
+	/**
+	 * Comma seperated import string specifier or <code>null</code> if the first
+	 * data line should be interpreted as one.
+	 */
+	JTextField csvImportString = new JTextField(20);
 	/**
 	 * The checkbox stating whether nodes should be merged together.
@@ -188,4 +194,10 @@
 		osmDataUsername.setToolTipText("Login name (email) to the OSM account.");
 		osmDataPassword.setToolTipText("Login password to the OSM account. Leave blank to not store any password.");
+		csvImportString.setToolTipText("<html>Import string specification. Currently, only lat/lon pairs are imported.<br>" +
+				"<b>lat</b>: The latitude coordinate<br>" +
+				"<b>lon</b>: The longitude coordinate<br>" +
+				"<b>ignore</b>: Skip this field<br>" +
+				"An example: \"ignore ignore lat lon\" will use ' ' as delimiter, skip the first two values and read then lat/lon.<br>" +
+				"Other example: \"lat,lon\" will just read lat/lon values comma seperated.</html>");
 		drawRawGpsLines.setToolTipText("If your gps device draw to few lines, select this to draw lines along your track.");
 		drawRawGpsLines.setSelected(Main.pref.isDrawRawGpsLines());
@@ -197,4 +209,5 @@
 		osmDataUsername.setText(Main.pref.osmDataUsername);
 		osmDataPassword.setText(Main.pref.osmDataPassword);
+		csvImportString.setText(Main.pref.csvImportString);
 
 		// Display tab
@@ -221,5 +234,6 @@
 		warning.setFont(warning.getFont().deriveFont(Font.ITALIC));
 		con.add(warning, GBC.eop().fill(GBC.HORIZONTAL));
-
+		con.add(new JLabel("CSV import specification (empty: read from first line in data)"), GBC.eol());
+		con.add(csvImportString, GBC.eop().fill(GBC.HORIZONTAL));
 		
 		// Map tab
Index: src/org/openstreetmap/josm/gui/layer/RawGpsDataLayer.java
===================================================================
--- src/org/openstreetmap/josm/gui/layer/RawGpsDataLayer.java	(revision 37)
+++ src/org/openstreetmap/josm/gui/layer/RawGpsDataLayer.java	(revision 38)
@@ -42,5 +42,5 @@
 				}
 				if (evt.getPropertyName().equals("drawRawGpsLines") ||
-						evt.getPropertyName().equals("drawRawGpsLines"))
+						evt.getPropertyName().equals("forceRawGpsLines"))
 					Main.main.getMapFrame().repaint();
 			}
@@ -67,10 +67,9 @@
 			for (GeoPoint p : c) {
 				Point screen = mv.getScreenPoint(p);
-				if (Main.pref.isDrawRawGpsLines() && old != null) {
+				if (Main.pref.isDrawRawGpsLines() && old != null)
 					g.drawLine(old.x, old.y, screen.x, screen.y);
-				} else {
+				else
 					g.drawRect(screen.x, screen.y, 0, 0);
-					old = screen;
-				}
+				old = screen;
 			}
 		}
Index: src/org/openstreetmap/josm/io/RawCsvReader.java
===================================================================
--- src/org/openstreetmap/josm/io/RawCsvReader.java	(revision 38)
+++ src/org/openstreetmap/josm/io/RawCsvReader.java	(revision 38)
@@ -0,0 +1,82 @@
+package org.openstreetmap.josm.io;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.StringTokenizer;
+
+import org.jdom.JDOMException;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.GeoPoint;
+
+/**
+ * Read raw information from a csv style file (as defined in the preferences).
+ * @author imi
+ */
+public class RawCsvReader {
+
+	/**
+	 * Reader to read the input from.
+	 */
+	private BufferedReader in;
+
+	public RawCsvReader(Reader in) {
+		this.in = new BufferedReader(in);
+	}
+	
+	public Collection<GeoPoint> parse() throws JDOMException, IOException {
+		Collection<GeoPoint> data = new LinkedList<GeoPoint>();
+		String formatStr = Main.pref.csvImportString;
+		if (formatStr == null)
+			formatStr = in.readLine();
+		if (formatStr == null)
+			throw new JDOMException("Could not detect data format string.");
+		
+		// get delimiter
+		String delim = ",";
+		for (int i = 0; i < formatStr.length(); ++i) {
+			if (!Character.isLetterOrDigit(formatStr.charAt(i))) {
+				delim = ""+formatStr.charAt(i);
+				break;
+			}
+		}
+		
+		// convert format string
+		ArrayList<String> format = new ArrayList<String>();
+		for (StringTokenizer st = new StringTokenizer(formatStr, delim); st.hasMoreTokens();)
+			format.add(st.nextToken());
+
+		// test for completness
+		if (!format.contains("lat") || !format.contains("lon")) {
+			if (Main.pref.csvImportString != null)
+				throw new JDOMException("Format string is incomplete. Need at least 'lat' and 'lon' specification");
+			throw new JDOMException("Format string in data is incomplete or not found. Try setting an manual format string in Preferences.");
+		}
+		
+		int lineNo = 0;
+		try {
+			for (String line = in.readLine(); line != null; line = in.readLine()) {
+				lineNo++;
+				StringTokenizer st = new StringTokenizer(line, delim);
+				GeoPoint p = new GeoPoint();
+				for (String token : format) {
+					if (token.equals("lat"))
+						p.lat = Double.parseDouble(st.nextToken());
+					else if (token.equals("lon"))
+						p.lon = Double.parseDouble(st.nextToken());
+					else if (token.equals("ignore"))
+						st.nextToken();
+					else
+						throw new JDOMException("Unknown data type: '"+token+"'."+(Main.pref.csvImportString == null ? " Maybe add an format string in preferences." : ""));
+				}
+				data.add(p);
+			}
+		} catch (RuntimeException e) {
+			throw new JDOMException("Parsing error in line "+lineNo, e);
+		}
+		return data;
+	}
+}
