{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "e9ac37de", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total de linhas: 875\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
UNPDVCIDADELOCAL DO PDVRECEITA PERÍODO ANTERIORRECEITA PERÍODO ATUALMETA PEFGAP ACORDADO (R$)GAP ACORDADO (%)REALIZADOarquivo_base
0Quem Disse Berenice910173MaceioShopping173913.810167464.53-167464.53-10C:\\Users\\joao.herculano\\GRUPO GINSENG\\Assistên...
1O Boticário21381Capim GrossoRua120594.400155346.60-155346.60-10C:\\Users\\joao.herculano\\GRUPO GINSENG\\Assistên...
2O Boticário23707Vitoria Da ConquistaRua131055.700159139.40-159139.40-10C:\\Users\\joao.herculano\\GRUPO GINSENG\\Assistên...
3O Boticário21068Simoes FilhoCash & Carry146448.380144695.45-144695.45-10C:\\Users\\joao.herculano\\GRUPO GINSENG\\Assistên...
4O Boticário20441LagartoRua225341.320311878.51-311878.51-10C:\\Users\\joao.herculano\\GRUPO GINSENG\\Assistên...
\n", "
" ], "text/plain": [ " UN PDV CIDADE LOCAL DO PDV \\\n", "0 Quem Disse Berenice 910173 Maceio Shopping \n", "1 O Boticário 21381 Capim Grosso Rua \n", "2 O Boticário 23707 Vitoria Da Conquista Rua \n", "3 O Boticário 21068 Simoes Filho Cash & Carry \n", "4 O Boticário 20441 Lagarto Rua \n", "\n", " RECEITA PERÍODO ANTERIOR RECEITA PERÍODO ATUAL META PEF \\\n", "0 173913.81 0 167464.53 \n", "1 120594.40 0 155346.60 \n", "2 131055.70 0 159139.40 \n", "3 146448.38 0 144695.45 \n", "4 225341.32 0 311878.51 \n", "\n", " GAP ACORDADO (R$) GAP ACORDADO (%) REALIZADO \\\n", "0 -167464.53 -1 0 \n", "1 -155346.60 -1 0 \n", "2 -159139.40 -1 0 \n", "3 -144695.45 -1 0 \n", "4 -311878.51 -1 0 \n", "\n", " arquivo_base \n", "0 C:\\Users\\joao.herculano\\GRUPO GINSENG\\Assistên... \n", "1 C:\\Users\\joao.herculano\\GRUPO GINSENG\\Assistên... \n", "2 C:\\Users\\joao.herculano\\GRUPO GINSENG\\Assistên... \n", "3 C:\\Users\\joao.herculano\\GRUPO GINSENG\\Assistên... \n", "4 C:\\Users\\joao.herculano\\GRUPO GINSENG\\Assistên... " ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import os\n", "import pandas as pd\n", "import glob\n", "\n", "# Caminho da pasta onde estão os arquivos\n", "pasta = r'C:\\Users\\joao.herculano\\GRUPO GINSENG\\Assistência Suprimentos - 2025\\SUPRIMENTOS\\DB_ORÇAMENTO FIANCEIRO\\meta pef baixada hj'\n", "\n", "# Lista todos os arquivos .xlsx no diretório\n", "arquivos_xlsx = glob.glob(os.path.join(pasta, '*.xlsx'))\n", "\n", "# Lista para armazenar os DataFrames\n", "dfs = []\n", "\n", "# Loop pelos arquivos encontrados\n", "for arquivo in arquivos_xlsx:\n", " try:\n", " df = pd.read_excel(arquivo, sheet_name='PERFORMANCE POR PDV', skiprows=2)\n", " df['arquivo_base'] = arquivo\n", " dfs.append(df)\n", " except Exception as e:\n", " print(f\"Erro ao ler {arquivo}: {e}\")\n", "\n", "# Concatena todos os DataFrames\n", "compilado_pef = pd.concat(dfs, ignore_index=True)\n", "\n", "# Exibe informações do DataFrame final\n", "print(f\"Total de linhas: {len(compilado_pef)}\")\n", "compilado_pef.head()" ] }, { "cell_type": "code", "execution_count": 11, "id": "40a4ace1", "metadata": {}, "outputs": [], "source": [ "compilado_pef.to_excel(r'C:\\Users\\joao.herculano\\GRUPO GINSENG\\Assistência Suprimentos - 2025\\SUPRIMENTOS\\DB_ORÇAMENTO FIANCEIRO\\PEF_ATUALIZADA.xlsx',index=False)" ] }, { "cell_type": "code", "execution_count": null, "id": "949b7fdc", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.2" } }, "nbformat": 4, "nbformat_minor": 5 }