Publi

Algunas hojas de cálculo recortan los CSV en las comillas [Minipost]

Es algo que me ha pasado estos días al exportar un archivo CSV de una base de datos (por ejemplo con este método). Era un CSV de unas 3000 filas y algunas de ellas tenían textos entre comillas en una de sus columnas.

El problema es que al abrirlo con LibreOffice Calc (tengo entendido que con WPS Office también pasaba), aquellas columnas que tenían textos entre comillas no salían bien y terminaban cortándose y dividiéndose.

Esto es porque, mi CSV tenía las comillas escapadas (como este carácter es el delimitador, se introduce \» (barra comillas) para diferenciarlo), pero, para este tipo de programas, los CSV no tienen carácter de escapado (\). En estos programas tenemos que utilizar dobles comillas («») para que se interprete que es un texto entre comillas dentro de un campo.

Como el CSV era bastante grande y no era plan de ir línea por línea, podemos utilizar este comando para convertirlo rápidamente:

1
sed 's/\"/""/g' original.csv > destino.csv

Con esto, convertimos todos los \» que encontramos en «» y ya podremos utilizarlo dentro de nuestro programa de hoja de cálculo.

También podría interesarte....

There are 20 comments left Ir a comentario

  1. Pingback: Algunas hojas de cálculo recortan los CSV en las comillas [Minipost] | PlanetaLibre /

  2. Mira Sherronm /
    Usando Google Chrome Google Chrome 116.0.0.0 en Windows Windows NT

    CSV files utilize double-quote marks to delimit field values with spaces, so Santa Claus is stored as «Santa Claus» to preserve the space. If a field value contains double-quotes, the double-quotes are dino game doubled-up so the parser can distinguish between them.

  3. rge /
    Usando Google Chrome Google Chrome 117.0.0.0 en Windows Windows NT

    I am extremely intrigued in this subject. Even though I have read numerous articles, I believe yours is the best. geometry dash 23

  4. Love status /
    Usando Google Chrome Google Chrome 97.0.4692.99 en Mac OS X Mac OS X 10.13.6

    Short videos for love whatsapp status heartfelt clips have become a popular way to share affection with the world of Love Status. Whether it’s a sweet message, a couple’s cherished moment, or a tribute to someone special, love videos encapsulate emotions in a matter of seconds.

  5. jsimitseo /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    You’ve got the golden ticket to the world of the biggest web slots. Fantastic. สล็อตเว็บใหญ่

  6. jsimitseo /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    Have you considered reaching out to manufacturers with your concerns? Customer feedback can drive change. เว็บสล็อตแตกง่าย

  7. yitzchak kerrigan /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    Good publish, it’s a very awesome weblog you have right here, continue the great function, is going to be back again. pokój na poddaszu

  8. yitzchak kerrigan /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    Really! Everything that a opener it blog post was for my situation. A great deal enjoyed, bookmarked, As i can’t look ahead to alot more! Ottawa Rims

  9. jsimitseo /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    A debt of gratitude is in order for composing such a decent article, I staggered onto your blog and read a couple of post. I like your style of composing… รวมสล็อตทุกค่ายในเว็บเดียว

  10. ghori92 /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    A very excellent blog post. I am thankful for your blog post. I have found a lot of approaches after visiting your post. изработка на уеб сайт

  11. yitzchak kerrigan /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    Fantastic submit, Many thanks regarding revealing This kind of information. Fantasticly composed write-up, only if almost all people supplied the identical amount of articles when you, the net would have been a greater spot. You should keep writing! บาคาร่าออนไลน์

  12. jsimitseo /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    Good subject, comparative writings are I don’t know whether they are on a par with your work out. เกมสล็อตโรม่า

  13. jsimitseo /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    It is fine, in any case assess the data and actualities around this right. เกมไพ่ป๊อกเด้ง

  14. HJFT /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    I think this is a really good article. You make this information interesting and engaging. You give readers a lot to think about and I appreciate that kind of writing. UFABETสมัครไม่มีขั้นต่ำปลอดภัย

  15. MUZAMMIL SEO MUZAMMIL SEO /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    Thank you for such a well written article. It’s full of insightful information and entertaining descriptions. Your point of view is the best among many. UFABETแทงบอลผ่านมือถือตรงเว็บแม่

  16. alam alam /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    Wow! Such an amazing and helpful post this is. I really really love it. It’s so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also city of stanton

  17. Karter221 /
    Usando Google Chrome Google Chrome 121.0.0.0 en Windows Windows NT

    Well-Written article. It will be supportive to anyone who utilizes it, including me. Keep doing what you are doing – can’t pause to read more posts. Thanks for the precious help. 강릉 마사지

  18. jsimitseo /
    Usando Google Chrome Google Chrome 121.0.0.0 en Windows Windows NT

    Benefit as much as possible from primarily premium substances – you will discover him or her for: best concierge doctor

  19. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    I for one utilize them solely astounding components : you will see these people amid: meilicq.com

  20. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    A debt of gratitude is in order for the instructive and accommodating post, clearly in your blog everything is great.. สล็อตฝากถอนไม่มีขั้นต่ำ

Leave a Reply