Csv upload -- suggestion needed with non-English character in csv file

<p>Hi All,</p>
I have a process which uploads a csv file into a table. It works with the normal english characters. In case of non-English characters in the csv file it doesn't populate the actual columns.
My csv file content is
<p></p>First Name | Middle Name | Last Name
<p><span style="background-color: #FF0000">José</span> | # | Reema</p>
<p>Sam | # | Peter</p>
<p>Out put is coming like : (the last name is coming as blank )</p>
First Name | Middle Name | Last Name
<p><span style="background-color: #FF0000">Jos鬣</span> | Reema | <span style="background-color: #FF0000"> blank </span></p>
<p>Sam | # | Peter</p>
http://apex.oracle.com/pls/otn/f?p=53121:1
workspace- gil_dev
user- apex
password- apex12
Thanks for your help.
Manish

Manish,
PROCEDURE csv_to_array (
      -- Utility to take a CSV string, parse it into a PL/SQL table
      -- Note that it takes care of some elements optionally enclosed
      -- by double-quotes.
      p_csv_string   IN       VARCHAR2,
      p_array        OUT      wwv_flow_global.vc_arr2,
      p_separator    IN       VARCHAR2 := ';'
   IS
      l_start_separator   PLS_INTEGER    := 0;
      l_stop_separator    PLS_INTEGER    := 0;
      l_length            PLS_INTEGER    := 0;
      l_idx               BINARY_INTEGER := 0;
      l_quote_enclosed    BOOLEAN        := FALSE;
      l_offset            PLS_INTEGER    := 1;
   BEGIN
      l_length := NVL (LENGTH (p_csv_string), 0);
      IF (l_length <= 0)
      THEN
         RETURN;
      END IF;
      LOOP
         l_idx := l_idx + 1;
         l_quote_enclosed := FALSE;
         IF SUBSTR (p_csv_string, l_start_separator + 1, 1) = '"'
         THEN
            l_quote_enclosed := TRUE;
            l_offset := 2;
            l_stop_separator :=
                   INSTR (p_csv_string, '"', l_start_separator + l_offset, 1);
         ELSE
            l_offset := 1;
            l_stop_separator :=
               INSTR (p_csv_string,
                      p_separator,
                      l_start_separator + l_offset,
                      1
         END IF;
         IF l_stop_separator = 0
         THEN
            l_stop_separator := l_length + 1;
         END IF;
         p_array (l_idx) :=
            (SUBSTR (p_csv_string,
                     l_start_separator + l_offset,
                     (l_stop_separator - l_start_separator - l_offset
         EXIT WHEN l_stop_separator >= l_length;
         IF l_quote_enclosed
         THEN
            l_stop_separator := l_stop_separator + 1;
         END IF;
         l_start_separator := l_stop_separator;
      END LOOP;
   END csv_to_array;and
PROCEDURE get_records (p_clob IN CLOB, p_records OUT varchar2_t)
   IS
      l_record_separator   VARCHAR2 (2) := CHR (13) || CHR (10);
      l_last               INTEGER;
      l_current            INTEGER;
   BEGIN
      -- SIf HTMLDB has generated the file,
      -- it will be a Unix text file. If user has manually created the file, it
      -- will have DOS newlines.
      -- If the file has a DOS newline (cr+lf), use that
      -- If the file does not have a DOS newline, use a Unix newline (lf)
      IF (NVL (DBMS_LOB.INSTR (p_clob, l_record_separator, 1, 1), 0) = 0)
      THEN
         l_record_separator := CHR (10);
      END IF;
      l_last := 1;
      LOOP
         l_current := DBMS_LOB.INSTR (p_clob, l_record_separator, l_last, 1);
         EXIT WHEN (NVL (l_current, 0) = 0);
         p_records (p_records.COUNT + 1) :=
            REPLACE (DBMS_LOB.SUBSTR (p_clob, l_current - l_last, l_last),
         l_last := l_current + LENGTH (l_record_separator);
      END LOOP;
   END get_records;Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://htmldb.oracle.com/pls/otn/f?p=31517:1
-------------------------------------------------------------------

Similar Messages

  • Error when import file with non-english character

    Hi,<br /><br />I have images file with non-english character (unicode), for example ABC<X>.png where <X> is non-english character such as japanese, chinese, etc.<br /><br />Whenever I want to import the file to After Effects (right click -> import -> file), I always encounter error:<br /><br />Finding file/dir info for the file "C:\...\ABC?.png" -- file not found (-43) (3::30)<br />Can't import file "ABC?.png": unsupported filetype or extension. (0::1)<br /><br />My PC is Windows XP Professional 2002 SP2 English.<br /><br />How to solve this problem?<br /><br />Thanks

    Adjust your system language settings. Proper file name conventions require a consistent Unicode environment, so install the respective foreign language support files or switch the language system-wide. Mixing different zones/ code ranges is always a bad idea. If your system is not in Japanese, AE will always misinterpret the characters and refuse to import. If that's not feasible, simply rename the files.
    Mylenium

  • N91 problem sending SMS with non English character...

    Hello I own a N91 4GB version. I have upgraded to version 2.20.008. I checked recently and have not found a newer version available for download.
    When composing an SMS a counter appears on the upper part of the screen, which shows how many characters remain and how many SMS(s) will be sent.
    When I use my native language, i.e. Greek, the counter starts as usual with 160 characters. When I type the first character it drops to 69 characters and then it works correctly decreasing the counter by 1. The result is that the phone sends more than 1 SMS even if there are no more than 160 characters.
    The problem does not appear if I use English characters.
    Is there a way to fix this? Do other users have the same problem?

    Hello alsanico,
    I'm from Greece too.
    I haven't seen N91's exact menu but i suppose it has similarities with my N95. They both run S60.
    Settings-
    General-
    Personalisation-
    Language-
    Writing Language-Ellinika
    If you have already made these settings then go to:
    Messaging-
    Options (left selection key)-
    Settings-
    Text Message-
    Character encoding-
    Reduced support
    Hope this helps...

  • Problems with non-English character.

    Hi
    My problem is that '������' become rubbish in my c++ dll. I hope someone can help me.
    ---Java code-----
    class Test
         private native void print(String str);
         public static void main(String [] args)
              new Test().print("������");
         static
              System.loadLibrary("Test");
    ----c++ code----
    JNIEXPORT void JNICALL
    Java_Test_print(JNIEnv *env, jobject obj, jstring jstr)
         const char * str = env->GetStringUTFChars(jstr, 0);
         if (str == NULL) {
              return; /* OutOfMemoryError already thrown */
         wstring str2(200, ' ');
         MultiByteToWideChar(CP_ACP, 0, str, strlen(str)+1, (LPWSTR)str2.data(),strlen(str));
         printf(">>> %s\n\n", str);
         cout << " str: " << str << ", str2.data: " << str2.data() << endl;
         return;
    ----OutPut-----
    &#9500;�&#9500;�&#9500;�&#9500;�&#9500;�&#9500;&#9570;str: &#9500;�&#9500;�&#9500;�&#9500;�&#9500;�&#9500;&#9570;, str2.data: 02CB6118
    Thanks
    Fredrik

    Hi,
    You will probably see the same rubbish if you try to print them to the console using java. Dos prompts usually have problems to print the Swedish characters. I don't know if this will affect your c++ dll or not. But you can specify the encoding for the JVM (-Dfile.encoding). For valid encodings see:
    http://www.mindprod.com/jgloss/encoding.html
    /Kaj

  • Upload text files with non-english characters

    I use an Apex page to upload text files. Then i retrieve the contents of files from wwv_flow_files.blob_content and convert them to varchar2 with utl_raw.cast_to_varchar2, but characters like ò, à, ù become garbage.
    What could be the problem? Are characters lost when files are stored in wwv_flow_files or when i do the conversion?
    Some other info:
    * I see wwv_flow_files.DAD_CHARSET is set to "ascii", wwv_flow_files.FILE_CHARSET is null.
    * Trying utl_raw.cast_to_varchar2( utl_raw.cast_to_raw('àòèù') ) returns 'àòèù' correctly;
    * NLS_CHARACTERSET parameter is AL32UTF8 (not just english ASCII)

    Hi
    Have a look at csv upload -- suggestion needed with non-English character in csv file it might help you.
    Thanks,
    Manish

  • Naming files with non English characters.

    I'm using filemaker to creat PDF's through Acrobat 10.1.12. I need to use Polish, Hungarian, Czech and Slovakian characters in the file name but the characters are not recognised and so the file name will not create. This is for Windows, the problem does not occur on a mac.

    Hi
    Have a look at csv upload -- suggestion needed with non-English character in csv file it might help you.
    Thanks,
    Manish

  • Does querybuilder support non-english character?

    I want to make query using querybuilder with non-english character (Chinese)?
    I tried with http://localhost:4502/libs/cq/search/content/querydebug.html but it is not working.
    below is my query string:
    property=contenttext
    property.value=&#20320;&#22909;&#21966;
    I have converted the chinese character (你好嗎)to unicode.
    Can anyone help me?

    That's a bug in the debugger UI. But it's easy to fix:
    in crxde lite, overlay /libs/cq/search/components/querydebug/querydebug.jsp by copying it to /apps/cq/search/components/querydebug/querydebug.jsp
    open /apps/cq/search/components/querydebug/querydebug.jsp
    find the line "props.load(new ByteArrayInputStream(queryParam.getBytes("ISO-8859-1")));"
    and replace with "props.load(new StringReader(queryParam));"
    Will be fixed in 5.6.1.

  • Customer Mss Upload with non ENGLISH language

    Hi,
    I have a BDC program which uploads customer Address data into the system.
    Now I have some customer data with non english characters like chinese and Japanese. If I try to upload this data with english language LOGON then data doesnt updates correctly but if I use the corresponding language logon and upload the same data then it works fine.
    Is there any ways I can upload these non english customer data with english system logon using BDCs or do I need to use any other approach?

    Hi Benson,
    Can you please elaborate on the issue. What characters are missing?
    Regards.
    Ruchit.

  • Logon with non-English language LSMW donot display character

    hi,When I Logon with non-english language ,
    When I use LSMW ,
    But the screen donot display character,
    and in smlt , i setting supplementation language is english ,
    who can help me ,thanks.

    Hi Benson,
    Can you please elaborate on the issue. What characters are missing?
    Regards.
    Ruchit.

  • Problem with Vcard and non-English character

    VCard feature is what I would like to use, but I have quite a few contacts with Non-English name (Korean).
    I know Ipod can display in Korean, but when I create a v-card with Korean character and copy the vcard file over into /contacts folder, I can see the filename as the person's name (From windows explorer), but I can ONLY see first character of the file when I display contacts in iPod.
    Does anyone have tips/tricks on displaying all the filename in IPod contacts?
    Thanks.
      Windows XP Pro  

    Because i use the string nota into a jsp page and i print the string nota into a textarea and the text is with no newline, example:
    <textarea name="nota" rows="4" cols="60"><%= nota %></textarea>
    the text into textarea is:
    first linesecond linethird line
    but i want that the text displayed into textarea is equal the text into the CDATA section:
    first line
    second line
    third line

  • Spool non english character names to a file

    Hi There,
    We have a table which has around a million rows. We just need to select two columns(out of which one is a name field with english and non english names) and spool the data to a file. The problem is that through sqldeveloper, if I choose csv or dsv option, the non english names, like chines charaters etc show up as question marks. Is there a better way or format to do this. I tries xls. But although it goes through successfully, when I open the excel file, it has nothing. I was able to do it for around 200000 rows in excel.
    Any suggesstions?
    Thanks,
    Sun
    Edited by: ryansun on Jun 23, 2012 4:24 AM

    ryansun wrote:
    Hi There,
    We have a table which has around a million rows. We just need to select two columns(out of which one is a name field with english and non english names) and spool the data to a file. The problem is that through sqldeveloper, if I choose csv or dsv option, the non english names, like chines charaters etc show up as question marks. Is there a better way or format to do this. I tries xls. But although it goes through successfully, when I open the excel file, it has nothing. I was able to do it for around 200000 rows in excel.
    Any suggesstions?
    Thanks,
    Sun
    Edited by: ryansun on Jun 23, 2012 4:24 AMwhen dealing with non-ASCII characters, two different issues can exist,
    1) data storage - incorrect byte value is stored
    2) data presentation - incorrect character is displayed.
    Can the utility utilized to view the *CSV file actually display the non-ASCII value properly?
    can you inspect the *CSV file using an hexadecimal editor? what do you see inside the file?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Problem with Non-English Fields Output to PDF by JASPER in JDev10.1.3

    I am using jsprx files(designed in i-report) to generate pdf reports out of an oracle database.
    The non-English fields are shown correctly when I output the report into an HTML or when I view it with JasperView.
    If I try making PDF files (JasperExportManager.exportReportToPdfFile) the static fields containing e.g.Arabic/Chineese characters won't be displayed and dynamic fields from the database with non-English contents will be shown as ??? or null.
    I received some suggestions about using PARAMETERS to feed the report instead of FIELDS, which I think can not be helpful in this case and in general.
    I think this should be a common problem. These are the components I am using:
    itext-1.4.7. jar
    commons-digester- 1.7.zip
    jasperreports- 1.2.8.jar
    Any comment or help is appreciated.
    Thanks
    Farbod

    I am using jsprx files(designed in i-report) to generate pdf reports out of an oracle database.
    The non-English fields are shown correctly when I output the report into an HTML or when I view it with JasperView.
    If I try making PDF files (JasperExportManager.exportReportToPdfFile) the static fields containing e.g.Arabic/Chineese characters won't be displayed and dynamic fields from the database with non-English contents will be shown as ??? or null.
    I received some suggestions about using PARAMETERS to feed the report instead of FIELDS, which I think can not be helpful in this case and in general.
    I think this should be a common problem. These are the components I am using:
    itext-1.4.7. jar
    commons-digester- 1.7.zip
    jasperreports- 1.2.8.jar
    Any comment or help is appreciated.
    Thanks
    Farbod

  • Reading a non-english character

    Hi, I have a trouble with reading a non-english character from a html page.
    I'm taking the word from the html page, and compare it with itself,
    like this
    string.equals("B&#304;TT&#304;")
    but it returns false.
    is it possible to correct this?

    specify an encoding for your inputstream reader:
    BufferedReader in = new BufferedReader(
                new InputStreamReader(new FileInputStream("infilename"), "8859_1")); for example

  • [SOLVED!] On USB drives, problems with non-English chars and HAL

    Hello,
    I am having a problem with non-English caracters (áãàçéẽê...) on files stored on my USB drive.
    On Windows they're created with the correct name. But on Linux the files have the non-English characteres replaced by '?' and are not accessible.
    If I manuallly mount the drives using 'mount -o iocharset=utf8 /dev/sdb1 /media/usbdisk' the characters are OK, so I think I just need to get HAL to pass the correct parameters to mount. However I don't know how to do that, and haven't found any good solution.
    I tried to build a custom kernel setting the default charset as UTF-8 and it didn't work.
    Any ideas? I'm using x86-64, HAL 0.5.13-3 and my locale is pt-BR.UTF-8.
    Thanks!
    EDIT: Actually, this is not a HAL problem, but a problem with 'exo'. For the solution, I edited /etc/xdg/xfce4/mount.rc and added iocharset=utf8 to the [vfat] category.
    Last edited by Renan Birck (2009-11-28 20:54:23)

    I don't use Thunar presently, but I looked in the Thunar Volume Manager doc and I didn't find anything to change the mount options of removable drives. I am not quite sure if it's possible or not. Maybe someone using it can tell for sure.
    But if it is not possible to change the mount options, a possible solution is to disable the Thunar Volume Manager plugin and to use something else more configurable to manage the automount function.
    Personally I use the halevt package from AUR which uses configuration files in the xml format.
    It's not so easy to use but is highly configurable.
    But there exists other tools also.
    I can help you with halevt if you choose that way...

  • Getting a request in a non English character

    Hi ,
    In an attempt to solve a problem of getting a request in a non English character , i use the code , taken from O'Reilly's "Java Servlet programing" First edition:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class MyServlet extends HttpServlet {
         public void doGet(HttpServletRequest req, HttpServletResponse res)
                                                                               throws ServletException, IOException {
              try {
                                                      //set encoding of request and responce
         req.setCharacterEncoding("Cp1255"); //for hebrew windows
         res.setCharacterEncoding("Cp1255");
         res.setContentType("Text/html; Cp1255");
         String value = req.getParameter("param");
                                                      // Now convert it from an array of bytes to an array of characters.
         // Here we bother to read only the first line.
                                                      BufferedReader reader = new BufferedReader(
         new InputStreamReader(new StringBufferInputStream(value), "Cp1255"));
                                                      String valueInUnicode = reader.readLine();
              }catch (Exception e) {
              e.printStackTrace();
    this works fine , the only problem is that StringBufferInputStream is deprecated .
    is there any other alternative for that ?
    Thanks in advance
    Yair

    Hi Again ..
    To get to the root of things , here is a servlet test and an http client test which demonstrates using the above patch and not using it :
    The servlet :
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.io.StringBufferInputStream;
    public class Hebrew2test extends HttpServlet {
         public void doGet(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException {
              request.setCharacterEncoding("Cp1255");
              response.setCharacterEncoding("Cp1255");
              response.setContentType("Text/html; Cp1255");
              PrintWriter out = response.getWriter();
              String name = request.getParameter("name");
              //print without any patch
              out.println(name);
              //a try with patch 1 DEPRECATED
              out.println("patch 1:");
              BufferedReader reader =
              new BufferedReader(new InputStreamReader(new StringBufferInputStream(name), "cp1255"));
              String patch_name = reader.readLine();
              out.println(patch_name);
              //a try with patch 2 which doesn't work          
              out.println("patch 2:");
              String valueInUnicode = new String(name.getBytes("Cp1255"), "UTF8");
              out.println(valueInUnicode);
    and now for a test client :
    import java.io.*;
    import java.net.*;
    public class HttpClient_cp1255 {
    private static void printUsage() {
    System.out.println("usage: java HttpClient host port");
    public static void main(String[] args) {
    if (args.length < 2) {
    printUsage();
    return;
    // Host is the first parameter, port is the second
    String host = args[0];
    int port;
    try {
    port = Integer.parseInt(args[1]);
    catch (NumberFormatException e) {
    printUsage();
    return;
    try {
    // Open a socket to the server
    Socket s = new Socket(host, port);
    // Start a thread to send reuest to the server
    new Request_(s).start();
    // Now print everything we receive from the socket
    BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream(),"cp1255"));
    String line;
    File f = new File("in.txt");
    FileWriter out = new FileWriter(f);
    while ((line = in.readLine()) != null) {
    System.out.println(line);
    out.write(line);
    out.close();
         catch (Exception e) {
    e.printStackTrace();
    class Request_ extends Thread {
    Socket s;
    public Request_( Socket s) {
    this.s = s;
    setPriority(MIN_PRIORITY); // socket reads should have a higher priority
    // Wish I could use a select() !
    setDaemon(true); // let the app die even when this thread is running
    public void run() {
    try {
                        OutputStreamWriter server = new OutputStreamWriter(s.getOutputStream(),"cp1255");
                        //String query= "GET /userprofiles/hebrew2test?name=yair"; //yair in Englisg ..
                        String query= "GET /userprofiles/hebrew2test?name=\u05d9\u05d0\u05d9\u05e8"; //yair in hebrew - in unicode
                   System.out.println("Connected... your HTTP request is sent");
                        System.out.println("------------------------------------------");
                        server.write(query);
                        server.write("\r\n"); // HTTP lines end with \r\n
                        server.flush();
                        System.out.println(server.getEncoding());
         server =      new OutputStreamWriter(new FileOutputStream("out.txt"),"cp1255");
                        server.write(query);
                        server.flush();
    catch (Exception e) {
    e.printStackTrace();

Maybe you are looking for

  • Return / Exchange Question...

    I recently bought a MBP and when I got it opened, there was a small nick in the aluminum below the keyboard. I went in to the apple store twice about it, and the second time they were very helpful and told me to call apple care. After a while on the

  • How does apple TV cache content, + use with imac

    I am thinking about buying an apple TV, but have some questions -does the Apple TV only stream content in real time, or can it store content e.g If I want to watch a film with the family, can I download the full film to the apple tv in advance, or do

  • Cannot download updates without error message

    Whenever I try to download my computer's updates, an error message pops up saying that I do not have sufficient admin privileges to download them. This is troubling because my account is the only account on my computer, and is clearly registered as a

  • JDeveloper doesn't show all files in the directory

    Hello, I think some basic functionalities are missing in JDeveloper, one of these basic functionalities is the importing of files. You can't import existing business components in your project, so you have to put them in a directory physically. I did

  • Message driven bean and message style web service

    Hi, I'm trying to deploy a message style web service with a message driven EJB as the receiver and am getting the following exception: <Jan 22, 2002 10:51:06 AM PST> <Warning> <EJB> <MessageDrivenBean threw an Exception in onMessage(). The exception