Topic
  • 1 reply
  • Latest Post - ‏2017-03-13T10:58:16Z by zinal
SystemAdmin
SystemAdmin
603 Posts

Pinned topic jaql schema with semi column delimiter

‏2013-03-14T06:55:17Z |
Hi

i have used the following text file with 3 columns empid,name,place and they are separated with semicolumn delimiter

emp001;"John",Paul,Prince;USA
emp002";Smith;UK
emp003;James;sec;UK

and i have defined following query for schema and it worked fine.

data = read(del(location="swarna/emp4.txt",delimiter =";" ,schema = schema{ empid, name, place}));

but i am getting an error ( delimiter missing in field starting at position 6) when i count the fileds using following query

data -> group into count($);

can any one suggest me how to define schema for my input file....

i have attached a file(error) please find it.....
  • zinal
    zinal
    1 Post

    Re: jaql schema with semi column delimiter

    ‏2017-03-13T10:58:16Z  

    Hi!

    Although a lot of time have passed, I have a response for your question.

    Your example data is not quoted properly.

    You can use the quoted=false property to parse it, e.g.:

    
    data = read(del(location="swarna/emp4.txt",delimiter =";", quoted=false, schema = schema{ empid, name, place}));