I want to insert a file into postgresql using JDBC. I know the below command to use but the file downloaded is not parsed with a delimiter("|" or ",")
Filereader fr = new FileReader("mesowest.out.txt"); cm.copyIn("COPY tablename FROM STDIN WITH DELIMITER '|'", fr); My file looks like this :
ABAUT 20131011/0300 8.00 37.84 -109.46 3453.00 21.47 8.33 241.90 ALTU1 20131011/0300 8.00 37.44 -112.48 2146.00 -9999.00 -9999.00 -9999.00 BDGER 20131011/0300 8.00 39.34 -108.94 1529.00 43.40 0.34 271.30 BULLF 20131011/0300 8.00 37.52 -110.73 1128.00 56.43 8.07 197.50 CAIUT 20131011/0300 8.00 38.35 -110.95 1381.00 54.88 8.24 250.00 CCD 20131011/0300 8.00 40.69 -111.59 2743.00 27.94 8.68 285.40 So my question is .. is it necessary to append delimiters to this file to push it into the database using jdbc?