5 Replies - 1925 Views - Last Post: 28 December 2012 - 12:14 PM Rate Topic: -----

#1 IngeniousHax  Icon User is offline

  • |>|20-514<|{3|2

Reputation: 78
  • View blog
  • Posts: 1,362
  • Joined: 28-March 09

postgresql 9 embedded delimiter

Posted 19 December 2012 - 05:13 PM

Hey guys, How can I handle embedded delimiters in a CSV file?
Is This A Good Question/Topic? 0
  • +

Replies To: postgresql 9 embedded delimiter

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9574
  • View blog
  • Posts: 36,262
  • Joined: 12-June 08

Re: postgresql 9 embedded delimiter

Posted 19 December 2012 - 05:24 PM

What do you mean 'handle'?
Was This Post Helpful? 0
  • +
  • -

#3 e_i_pi  Icon User is offline

  • = -1
  • member icon

Reputation: 801
  • View blog
  • Posts: 1,700
  • Joined: 30-January 09

Re: postgresql 9 embedded delimiter

Posted 19 December 2012 - 06:39 PM

We're going to need a bit more information here. What is it exactly that you are trying to do? Is this some sort of parameterised query you're trying to run, with a delimited parameter being passed?
Was This Post Helpful? 0
  • +
  • -

#4 IngeniousHax  Icon User is offline

  • |>|20-514<|{3|2

Reputation: 78
  • View blog
  • Posts: 1,362
  • Joined: 28-March 09

Re: postgresql 9 embedded delimiter

Posted 28 December 2012 - 11:38 AM

No, I am copying a file to a schema and there seems to be embedded delimiters in the CSV file. So instead of just having something like:
name1, name2, num, dateA, dateB, reasoning

I have:
name1, name2, num, dateA, dateB, reas,oning

EDIT:: I am currently trying to write a CSV file filter in C++ to filter out the embedded delimiters, but am running into the same problem with trying to avoid them...

This post has been edited by IngeniousHax: 28 December 2012 - 11:41 AM

Was This Post Helpful? 0
  • +
  • -

#5 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3730
  • View blog
  • Posts: 6,017
  • Joined: 08-June 10

Re: postgresql 9 embedded delimiter

Posted 28 December 2012 - 11:56 AM

Is that comma supposed to be a part of the value?

That would tend to be handled like this
name1, name2, num, dateA, dateB, "reas,oning"


The quote marks there would be a sort of secondary delimiter, indicating that the comma within it should be read as a value rather than a delimiter.
Was This Post Helpful? 0
  • +
  • -

#6 IngeniousHax  Icon User is offline

  • |>|20-514<|{3|2

Reputation: 78
  • View blog
  • Posts: 1,362
  • Joined: 28-March 09

Re: postgresql 9 embedded delimiter

Posted 28 December 2012 - 12:14 PM

Right but the problem I am having is I can't get it to do that, since there are no spaces between the commas, IDK how to format it correctly...

The file looks exactly like this:
name1,name2,num,dateA,dateB,reas,oning

And I have a CSV file that is like:
name1,name2,num,dateA,dateB,"reas","oning"

But it seems that whoever is formatting the files prior to getting to me, doesn't catch this problem.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1