{"id":991,"date":"2022-03-31T09:37:29","date_gmt":"2022-03-31T09:37:29","guid":{"rendered":"https:\/\/nmbm.biz\/sitio\/?p=991"},"modified":"2022-03-31T15:06:11","modified_gmt":"2022-03-31T15:06:11","slug":"libreoffice-calc-converter-conteudo-das-celulas-em-numeros","status":"publish","type":"post","link":"https:\/\/blog.webgescom.pt\/blog\/libreoffice-calc-converter-conteudo-das-celulas-em-numeros\/","title":{"rendered":"LibreOffice Calc &#8211; converter conte\u00fado das c\u00e9lulas em n\u00fameros"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Algumas aplica\u00e7\u00f5es, nomeadamente de gest\u00e3o comercial ou contabilidade, exportam dados em formato do Microsoft Excel que n\u00e3o s\u00e3o devidamente interpretadas pelo LibreOffice Calc (ou pelo OpenOffice Calc). Por exemplo, se a c\u00e9lula contiver espa\u00e7os antes dos digitos, espa\u00e7o no separador dos milhares, ou ainda a plica (&#8216;) antes dos algarismos. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"311\" height=\"345\" src=\"https:\/\/nmbm.biz\/sitio\/wp-content\/uploads\/2022\/03\/libreoffice-valor-01.jpg\" alt=\"\" class=\"wp-image-993\" srcset=\"https:\/\/blog.webgescom.pt\/blog\/wp-content\/uploads\/2022\/03\/libreoffice-valor-01.jpg 311w, https:\/\/blog.webgescom.pt\/blog\/wp-content\/uploads\/2022\/03\/libreoffice-valor-01-270x300.jpg 270w\" sizes=\"auto, (max-width: 311px) 100vw, 311px\" \/><figcaption>Aspecto inicial das c\u00e9lulas com valores<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Como se pode verificar na imagem, as c\u00e9lulas est\u00e3o desalinhadas e, seleccionando uma ou v\u00e1rias, o LibreOffice n\u00e3o as trata como n\u00fameros.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">O procedimento a seguir, desenrola-se nesta sequ\u00eancia,<span style=\"text-decoration: underline;\"> seleccionando todas as c\u00e9lulas que queremos expurgar de caracteres indesejados<\/span>:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Eliminar eventuais espa\u00e7os, antes dos algarismos: no menu <strong>Editar<\/strong> (Edit), seleccionar <strong>Encontrar e Substituir <\/strong>(Find and Replace Ctrl+H) . Na janela <strong>Encontrar e Substituir<\/strong> (Find and Replace), colocar um espa\u00e7o no campo <strong>Procurar<\/strong> (Find), n\u00e3o preencher <strong>Substituir<\/strong> (Replace), certificar-se que tem um visto em <strong>Selec\u00e7\u00e3o Actual<\/strong> (Current Selection) e carregar no bot\u00e3o <strong>Substituir Todos<\/strong> (Replace All);<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"564\" height=\"448\" src=\"https:\/\/nmbm.biz\/sitio\/wp-content\/uploads\/2022\/03\/libreoffice-valor-02.jpg\" alt=\"\" class=\"wp-image-994\" srcset=\"https:\/\/blog.webgescom.pt\/blog\/wp-content\/uploads\/2022\/03\/libreoffice-valor-02.jpg 564w, https:\/\/blog.webgescom.pt\/blog\/wp-content\/uploads\/2022\/03\/libreoffice-valor-02-300x238.jpg 300w\" sizes=\"auto, (max-width: 564px) 100vw, 564px\" \/><figcaption>A Janela Find and Replace<\/figcaption><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>Utilizar a formata\u00e7\u00e3o de c\u00e9lulas para ajustar os algarismos e for\u00e7ar a interpretar do espa\u00e7o como separador dos milhares: <span style=\"text-decoration: underline;\">com as c\u00e9lulas seleccionadas<\/span> e, no menu <strong>Formatar<\/strong> (Format), escolher <strong>C\u00e9lulas<\/strong> (Cells Ctrl+1). Na <strong>Categoria<\/strong> (Category), escolher <strong>N\u00famero<\/strong> (Number) e, do lado direito, escolher o formato desejado. Marcar o visto em <strong>Separador dos Milhares<\/strong> (Thounsands Separator) e carregar em <strong>OK<\/strong>.<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"507\" height=\"537\" src=\"https:\/\/nmbm.biz\/sitio\/wp-content\/uploads\/2022\/03\/libreoffice-valor-03.jpg\" alt=\"\" class=\"wp-image-995\" srcset=\"https:\/\/blog.webgescom.pt\/blog\/wp-content\/uploads\/2022\/03\/libreoffice-valor-03.jpg 507w, https:\/\/blog.webgescom.pt\/blog\/wp-content\/uploads\/2022\/03\/libreoffice-valor-03-283x300.jpg 283w\" sizes=\"auto, (max-width: 507px) 100vw, 507px\" \/><figcaption>A Janela Formatar C\u00e9lulas<\/figcaption><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>Finalmente, e porque o LibreOffice ainda trata o conte\u00fado das c\u00e9lulas como texto <sup>(1)<\/sup>, iremos utilizar a express\u00e3o regular para converter o conte\u00fado da c\u00e9lula em n\u00famero: novamente e <span style=\"text-decoration: underline;\">com todas as c\u00e9lulas seleccionadas<\/span>, escolher <strong>Seleccionar e Substituir<\/strong> (Find and Replace) do menu <strong>Editar<\/strong> (Edit). No campo <strong>Encontrar<\/strong> (Find), colocar <em>.*<\/em> (ponto e asterisco) e no campo <strong>Substituir<\/strong> (Replace), colocar <em>&amp;<\/em> (E comercial). Marcar o visto em <strong>Express\u00f5es Regulares<\/strong> (Regular Expressions) e carregar em <strong>Substituir Todos<\/strong> (Replace All).<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"563\" height=\"445\" src=\"https:\/\/nmbm.biz\/sitio\/wp-content\/uploads\/2022\/03\/libreoffice-valor-04.jpg\" alt=\"\" class=\"wp-image-996\" srcset=\"https:\/\/blog.webgescom.pt\/blog\/wp-content\/uploads\/2022\/03\/libreoffice-valor-04.jpg 563w, https:\/\/blog.webgescom.pt\/blog\/wp-content\/uploads\/2022\/03\/libreoffice-valor-04-300x237.jpg 300w\" sizes=\"auto, (max-width: 563px) 100vw, 563px\" \/><\/figure><\/div>\n\n\n\n<blockquote class=\"wp-block-quote has-small-font-size is-layout-flow wp-block-quote-is-layout-flow\"><p>(1) Se seleccionar-mos uma c\u00e9lula, verificamos que o LibreOffice coloca uma plica (&#8216;) antes dos algarismos na barra de f\u00f3rmulas &#8211; este car\u00e1cter, que n\u00e3o est\u00e1 vis\u00edvel na c\u00e9lula, impede que o conte\u00fado seja tratado como n\u00famero.<\/p><\/blockquote>\n<div class=\"pvc_clear\"><\/div><p id=\"pvc_stats_991\" class=\"pvc_stats all  \" data-element-id=\"991\" style=\"\"><i class=\"pvc-stats-icon small\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/blog.webgescom.pt\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p><div class=\"pvc_clear\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Algumas aplica\u00e7\u00f5es, nomeadamente de gest\u00e3o comercial ou contabilidade, exportam dados em formato do Microsoft Excel que n\u00e3o s\u00e3o devidamente interpretadas pelo LibreOffice Calc (ou pelo OpenOffice Calc). Por exemplo, se a c\u00e9lula contiver espa\u00e7os antes dos digitos, espa\u00e7o no separador dos milhares, ou ainda a plica (&#8216;) antes dos algarismos.<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_991\" class=\"pvc_stats all  \" data-element-id=\"991\" style=\"\"><i class=\"pvc-stats-icon small\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/blog.webgescom.pt\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[224],"tags":[228,230,229,227,225,226],"class_list":["post-991","post","type-post","status-publish","format-standard","hentry","category-libreoffice","tag-converter-valores","tag-exportacao-excel","tag-expressao-regular","tag-formatar-celulas","tag-libreoffice","tag-openoffice"],"aioseo_notices":[],"a3_pvc":{"activated":true,"total_views":2879,"today_views":0},"_links":{"self":[{"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/posts\/991","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/comments?post=991"}],"version-history":[{"count":7,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/posts\/991\/revisions"}],"predecessor-version":[{"id":1003,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/posts\/991\/revisions\/1003"}],"wp:attachment":[{"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/media?parent=991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/categories?post=991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/tags?post=991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}