Hello,
I have several XML files with a filename that I want to change in order to have an easier way to locate the file i need for future references, I use Mac Os
The actual filenames are almost a "random name".
The new filename should look like the follow structure, see example bellow:
[login to view URL]
[login to view URL]
[login to view URL]
Where:
a) "IMS421231I45" is the Vat ID that is actually in a specific field inside the file: " <emisor rfc="IMS421231I45">"
b) "AUCJ710419SI6" is the Vat ID that is actually in a specific field inside the file: " <cfdi:Receptor rfc="AUCJ710419SI6">"
c) "20170102" is the year, month and day YYYYMMDD inside the "fecha" field:
<cfdi:Comprobante xmlns:cfdi="[login to view URL]" xmlns:tfd="[login to view URL]" xmlns:xsi="[login to view URL]" version="3.2" fecha="2016-07-27T12:04:50" sello="AZCqZuTbgKeBkf/3fXc1pVINRqPy73ULAC2SawmzcyfV9OgwsPoPpwH943nhC92xn7y/7FRbQ63qpk/8vRoGsR7nSW1txyslPiLnC3Gdi5fIUEojyRrZINQc1zB2RITLsEX9NIuAj1TnvCX48koOUCh+97ppzBiv1WT7nnKoGQs=" formaDePago="PAGO EN UNA SOLA EXHIBICION" noCertificado="00001000000304541622" certificado="MIIErDCCA6H" subTotal="4540.48" total="4540.48" tipoDeComprobante="ingreso" metodoDePago="Desconocido" LugarExpedicion="MEXICO" xsi:schemaLocation="[login to view URL] [login to view URL]">
d) The last tree digits is a secuence number, just in case the same "emisor" has issued to "receptor" more than one time in that specific date.
I need a bash script to in a specific folder locate each field and rename the files according this criteria.
I will run this script on a monthly basis.
here you have 3 example files
Hope someone can help me
Regards
Jorge
I can create simple MacOS executable (not a Bash script) that will processl all XML files in a folder, parse each file (extract emisor, cfdi:Receptor, fecha etc) and rename the file.
Relevant Skills and Experience
I have worked on similar projects many times before (parsing XML and renaming the files) that's why I'm sure you'll be impressed with my work.
Proposed Milestones
$35 USD - MacOS script to rename files
$35 USD v 1 dni
5,0 (13 recenze)
4,0
4,0
2 freelanceři nabízejí v průměru $106 USD za tuto práci
Hi, How are you?
I've carefully read your description and I am very interested in your project.
I can complete your project within a day.
Relevant Skills and Experience
I have 5+ years of experience in the application for Mac OS X.
I want to discuss with you about your project in more detail.
Proposed Milestones
$176 USD - init