Messages - Ath [ switch to compact view ]

Pages: prev1 ... 56 57 58 59 60 [61] 62 63 64 65 66 ... 723next
301
Post New Requests Here / Re: NetTraffic xml export to Excel
« on: February 13, 2019, 03:17 PM »
Well, I mocked up a batchfile, using xmlstarlet to be downloaded here, that converts all "NetTraffic <date-time>.xml" files of current directory into a single NetTrafficAll.csv file.

(Used the PowerShell highlighter as Batch isn't supported by the board)
You'll need to adjust the path to the xml.exe file, and check the other settings as 'documented'
NOTE: No data-conversions done here, Excel can do that better and easier
Code: PowerShell [Select]
  1. @echo off
  2. :: Set the relative path to your xmlstarlet install:
  3. set XML=..\Downloads\XML\xmlstarlet-1.6.1\xml.exe
  4. :: Change filemask if desired
  5. set "FILEMASK=NetTraffic 2*.xml"
  6. :: Change result outputfile as desired, keep the .csv extension, when adding spaces, surround with quotes like FILEMASK
  7. set OUTFILE=NetTrafficAll.csv
  8. :: Add StatHour to this list if desired
  9. set "ELEMENTS=StatYear StatMonth StatDay"
  10. :: Choose csv separator, either , (comma) or ; (semicolon)
  11. set CSVSEP=;
  12.  
  13. set XMLARG1=sel -T -t -m NetTraffic/
  14. set XMLARG2=/key -v "concat('
  15. set XMLARG3=%CSVSEP%',@ts,'%CSVSEP%',@tm,'%CSVSEP%',@dl,'%CSVSEP%',@ul,'%CSVSEP%',@dx,'%CSVSEP%',@dy)" -n
  16.  
  17. :: Write header
  18. echo Period%CSVSEP%ts%CSVSEP%tm%CSVSEP%dl%CSVSEP%du%CSVSEP%dx%CSVSEP%dy>"%OUTFILE%"
  19. :: Loop all files from FILEMASK
  20. for %%F in ("%FILEMASK%") do (
  21. echo File: %%F
  22. :: Fetch all configured elements
  23. for %%G in (%ELEMENTS%) do (
  24. %XML% %XMLARG1%%%G%XMLARG2%%%G%XMLARG3% "%%F" >>"%OUTFILE%"
  25. )
  26. )

NOTE2: The csv file will be fully replaced each run of the script!

302
Post New Requests Here / Re: NetTraffic xml export to Excel
« on: February 13, 2019, 01:44 PM »
Thanks for sharing. And I'm happy my educated guess about the ts field was quite close :-[

Can you attach an original xml file to a reply? Scraping it from your messages doesn't provide the original structure, you seem to have taken clips from a webbrowser (the dashes in front of the <Stat elements give it away ;)) (Finally downloaded NetTraffic and did a testrun 8))

303
N.A.N.Y. 2019 / Re: NANY 2019: TextWorx - Universal Text Manipulator
« on: February 13, 2019, 01:33 PM »
Ath - I've added your base64 encode string function.
And it works like a charm, thanks :Thmbsup:

304
Use sed, the Stream EDitor, known from Linux, but also available for Windows. And here is a SO answer with details

The Windows download can be found here: http://gnuwin32.sourceforge.net/packages/sed.htm

305
Let me guess: You're on Windows 10?

Pages: prev1 ... 56 57 58 59 60 [61] 62 63 64 65 66 ... 723next
Go to full version