Re: Issue with copying data from a text file.
От | Andrej Ricnik-Bay |
---|---|
Тема | Re: Issue with copying data from a text file. |
Дата | |
Msg-id | b35603930703191953g73e0e28bl3012e7b6836ba780@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Issue with copying data from a text file. (Paul Lambert <paul.lambert@autoledgers.com.au>) |
Ответы |
Re: Issue with copying data from a text file.
|
Список | pgsql-sql |
On 3/20/07, Paul Lambert <paul.lambert@autoledgers.com.au> wrote: > The source file comes from extracts on our main application which sits > inside an in-house pretending-to-be-a-dbms file system. The content of > these extracts would be difficult to change - the extract program would > need to parse the data looking for quotes and preceed them with the > necessary escape character. > > Not being a proper database dump it's not a simple matter of flicking a > switch to get it to include the escape character. The way the extracts > are written would require a few dozen lines of code to each extract, and > theres about 40ish extracts. > > Plus I don't maintain that side of our code, and those that do can be a > bit lazy and I'd likely be waiting months to get it done - if they even > decide to do it. Pipe it through sed and replace the Carets with TABS? sed 's/^/\t/g' c:/temp/autodrs_deal_lines.txt > c:/temp/autodrs_deal_lines.tab Then use copy like so: \copy table from 'c:/temp/autodrs_deal_lines.tab' delimiter E'\t' null '' Cheers, Andrej
В списке pgsql-sql по дате отправления: