Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I'm new to Linux and also this forum. I have a bunch of .txt files on a remote server which contain tabled information (column names, entry values, comma separated). ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2009
    Posts
    2

    Unhappy Problem with 'recode' - Emergency!!


    Hi, I'm new to Linux and also this forum.


    I have a bunch of .txt files on a remote server which contain tabled information (column names, entry values, comma separated). I use putty to connect to the server and I am supposed to create a table for each file.

    When I use 'copy' statement like this:

    \copy table1 from '/something/file.txt' delimiter as ','

    I get the below error:

    ERROR: invalid byte sequence for encoding "UTF8": 0xff
    HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".


    The client encoding for the server is "UTF-8" (I used 'show client_encoding' to figure it out)

    The 'file.txt' encoding is 'data' (When I type: file file.txt, I get the word "data")

    I tried to change the encoding of 'file.txt' to 'UTF-8" using:

    "recode UTF-8 file.txt"


    But I received:


    "recode: file.txt failed: Invalid input in step `UTF-8..CHAR"


    Also when I used:


    "recode data..UTF-8 file.txt"


    I got :


    No way to recode from `data' to `UTF-8'
    recode: Request `data..UTF-8' is erroneous




    Can anybody of you guys please help me. I still am not very clear as what the real problem is...


    Thanks in advance.

  2. #2
    tpl
    tpl is offline
    Linux User
    Join Date
    Jan 2007
    Location
    cleveland
    Posts
    477
    welcome to the forum

    "putty" is a windows program: how can we help you with linux?
    the sun is new every day (heraclitus)

  3. #3
    Just Joined!
    Join Date
    Sep 2009
    Posts
    2
    Quote Originally Posted by tpl View Post
    welcome to the forum

    "putty" is a windows program: how can we help you with linux?
    Sorry.

    Forgot to say that I use Putty to connect to a remote server. The server is running in SunOS. When I use Putty and log in, I get the 'bash' prompt and can use linux commands. The database I connect to (and have to create tables in is a POSTGRES database)

    Any ideas?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •