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.
Pingback: Algunas hojas de cálculo recortan los CSV en las comillas [Minipost] | PlanetaLibre /
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.
I am extremely intrigued in this subject. Even though I have read numerous articles, I believe yours is the best. geometry dash 23
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.
You’ve got the golden ticket to the world of the biggest web slots. Fantastic. สล็อตเว็บใหญ่
Have you considered reaching out to manufacturers with your concerns? Customer feedback can drive change. เว็บสล็อตแตกง่าย
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
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
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… รวมสล็อตทุกค่ายในเว็บเดียว
A very excellent blog post. I am thankful for your blog post. I have found a lot of approaches after visiting your post. изработка на уеб сайт
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! บาคาร่าออนไลน์
Good subject, comparative writings are I don’t know whether they are on a par with your work out. เกมสล็อตโรม่า
It is fine, in any case assess the data and actualities around this right. เกมไพ่ป๊อกเด้ง
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สมัครไม่มีขั้นต่ำปลอดภัย
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แทงบอลผ่านมือถือตรงเว็บแม่
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
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. 강릉 마사지
Benefit as much as possible from primarily premium substances – you will discover him or her for: best concierge doctor
I for one utilize them solely astounding components : you will see these people amid: meilicq.com
A debt of gratitude is in order for the instructive and accommodating post, clearly in your blog everything is great.. สล็อตฝากถอนไม่มีขั้นต่ำ