Skip to content

Instantly share code, notes, and snippets.

@sergio
Last active June 16, 2021 06:48
Show Gist options
  • Select an option

  • Save sergio/cc40394a5c4982990ca7cacb0f7e77a8 to your computer and use it in GitHub Desktop.

Select an option

Save sergio/cc40394a5c4982990ca7cacb0f7e77a8 to your computer and use it in GitHub Desktop.
[Sumarize CFDIs] Extract CSV summary from CFDI xmls in folder #PowerShell
gci xmls | % { [xml]$x = gc $_; $c = $x.Comprobante; New-Object PSObject -Property @{Folio=$c.Folio;Serie=$c.Serie;RfcEmisor=$c.Emisor.Rfc;RfcReceptor=$c.Receptor.Rfc;UUID=$c.Complemento.TimbreFiscalDigital.UUID;FormaPago=$c.FormaPago;Total=$c.Total;Fecha=$c.Fecha;Tipo=$c.TipoDeComprobante}} | export-csv -Path cfdis.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment