How to copy a .out file to postgresql?

copy java out postgresql sqlbulkcopy

Question

I need to use Postgres and Java to enter the document (warning: possibly hazardous file download location) into the database. Please download it, then tell me how to extract data from it. I used the command copy. I was unable to utilize the header option, to start with. As you can see from the file, I have to transfer data starting with the fourth row. The delimiter is an additional factor. There is no actual delimiter, however they may be seen as regular columns if you open the file with Notepad++. I've attempted and overcome these difficulties. Help me obtain a custom query, please. Or another strategy that can help me accomplish what I want to. Thanks!

Edit: I downloaded the file from a safer site. hoping it works

1
-2
10/13/2012 2:41:35 PM

Accepted Answer

Therefore, it seems that you are creating fixed width files. Your best option is to open a spreadsheet, import the file (most can manage fixed width), and then export as CSV since COPY doesn't support these. Then, you may use COPY.

2
10/13/2012 12:27:19 PM


Related Questions





Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow