Windows 10: CSV to XML script not showing data

Discus and support CSV to XML script not showing data in Windows 10 Software and Apps to solve the problem; Hello everyone, Firstly, I don't know if this thread belongs in Software and Apps, if it doesn't feel free to move it to the correct sub-forum so I... Discussion in 'Windows 10 Software and Apps' started by Incntr0l, Nov 25, 2018.

  1. Incntr0l Win User

    CSV to XML script not showing data


    Hello everyone,

    Firstly, I don't know if this thread belongs in Software and Apps, if it doesn't feel free to move it to the correct sub-forum so I know for later where to put problems like this.

    To the problem now... I have been trying to export a huge CSV file via Powershell Scripting into a XML file using Export-CliXML, scripting and pipelining and for some reason after exporting approximately twenty thousand lines of a single document (which is much, MUCH bigger) some of the data has gone missing. At first I thought it was because of duplicates, but I am not so sure anymore because each line of data has a separate ID to it.

    An example of this is where one data line's ID (this is also from a false-file so to speak, a file that I made up to see what would happen if it was the duplicates combining) was "X9775KU2", the second was "K86HU17S" and the third was as shown in the first. Each one was separate and all were put in a XML file after exporting it, and was how I found out that it wasn't a duplicate problem.

    The twenty thousand lines of data that I had taken out of that huge document as a baseline set of data but each time I export as an XML from that twenty thousand between three and five lines of data (different each export) disappear from it. I have searched around the internet to see if some other sites had a way to solve this problem, but all of them were just about setting up a script to import a CSV then export it as XML.

    I am not sure where to go from here for the script. I should also say that my knowledge of Powershell scripts is quite poor as I am only just getting into it so I may have missed something obvious to most. If anyone has a way to solve this, please let me know.

    Thanks, .

    :)
     
    Incntr0l, Nov 25, 2018
    #1
  2. ddelo Win User

    Export All Administrative Events to Excel


    To analyze events, from the Windows Event Viewer, there is a simple way to export all Administrative Events to Excel, with PowerShell.

    Exporting all Administrative Events to Excel is a simple two Step process, as described here:

    Step 1 - Create the Administrative Events View .xml file
    1. Open Eventviewer (%windir%\system32\eventvwr.msc)
    2. Navigate to: Event Viewer (Local) > Custom Views > Administrative Events
    3. In the “Actions” pane select “Filter Current Custom View”.
    4. Select the the XML tab.
    5. Press Ctrl+A to select all the XML code of the Custom View.
    6. Open a notepad, paste the selected code and save the file to your Desktop as AdmEvtView.xml


    Step 2 - Create the csv file with the events
    1. Download the ExportEvtCSV.zip file, which contains the script ExportEvtCSV.ps1 and unzip it, on your Desktop.
      It's not a fancy script, just basic PowerShell commands to create a csv file on the Desktop.
    2. In Windows Search, type “ISE” (without the quotes) to open “Windows PowerShell ISE” and Run as administrator
    3. To allow running the script, change the ExecutionPolicy, for this session. To do that, in the Console pane type:
      Code:
      Code:
      Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -force
    4. In the Windows PowerShell ISE, open and run the script: ExportEvtCSV.ps1
      The script will create a csv file with a name YYYYMMDD.HHMM.csv on the Desktop
    5. When done, open the newly created .csv file, format the columns as needed and optionally save it as .xlsx, if you wish.
    That’s it! You now have all the Administrative Events in Excel for filtering and further analysis. CSV to XML script not showing data :)

    Now to the more technical hard stuff... *Confused

    There is a reason for running the script from within PowerShell ISE!

    It would be great if everything was also working perfectly, when running the script from an elevated PowerShell too.

    We can run it from an elevated PowerShell, which means that you just follow the Step 1, as above but for the Step 2 instead of the ISE you run the script from an elevated PowerShell.

    The problem is that it will work only for anybody who has en-US format for the dates. Everyone else, who has another format (i.e. en-GB, fr-FR, el-GR etc.), the dates are not translated properly by Excel (although the script uses the –UseCulture switch) and remain as text in the en-US format.

    I'm not sure if this a bug of the "export-csv" cmdlet, but although it runs the way it supposed to from within the ISE, from PowerShell there is a problem with the dates format.
    As I haven’t found a way to overcome this obstacle, any suggestion from the PowerShell gurus of the forum (like my good friend Shawn @Brink, for instance), is welcome.
     
    ddelo, Nov 25, 2018
    #2
  3. ability to script GPU-Z

    Is there a way to script GPU-Z I would like to be able to run GPU-Z from some scripting language and have the GPU info saved to a file in some format (XML, YAML etc).

    Any pointers/suggestion on how to get this information would be much appreciated
     
    mwoodpatrick, Nov 25, 2018
    #3
  4. CSV to XML script not showing data

    Help! Data partition not showing under my computer

    This is happening on a windows 2000 server. Our second partition of the system, for data is not showing under my computer. Here are the properties of it in disk management:


    CSV to XML script not showing data partition.jpg


    Now under logical drives its listed as F and shows free space available.

    Suggestions on how to fix this?
     
    Hybrid_theory, Nov 25, 2018
    #4
Thema:

CSV to XML script not showing data

Loading...
  1. CSV to XML script not showing data - Similar Threads - CSV XML script

  2. html to csv

    in Windows 10 Gaming
    html to csv: I am having trouble getting a file that isn't in a box downloaded from a website with html to csv so I can alter info in excel https://answers.microsoft.com/en-us/windows/forum/all/html-to-csv/8477dd64-97c6-4ad5-8f7c-e1df15d43541
  3. html to csv

    in Windows 10 Software and Apps
    html to csv: I am having trouble getting a file that isn't in a box downloaded from a website with html to csv so I can alter info in excel https://answers.microsoft.com/en-us/windows/forum/all/html-to-csv/8477dd64-97c6-4ad5-8f7c-e1df15d43541
  4. html to csv

    in Windows 10 Installation and Upgrade
    html to csv: I am having trouble getting a file that isn't in a box downloaded from a website with html to csv so I can alter info in excel https://answers.microsoft.com/en-us/windows/forum/all/html-to-csv/8477dd64-97c6-4ad5-8f7c-e1df15d43541
  5. XML Files

    in Windows 10 Software and Apps
    XML Files: Hi folks! Just registered to this forum and glad to have found it. So I was installing Ubuntu on my computer which already had windows 10.I wanted to have a dual OS. Things went south and windows got deleted/ over written or whatever. I used a hard drive recovery device to...
  6. Create csv file

    in Windows 10 Network and Sharing
    Create csv file: How do I create a csv file from, my contacts? https://answers.microsoft.com/en-us/windows/forum/all/create-csv-file/5f2fe32c-02eb-4a33-8f07-ff325c25e4a1
  7. Powershell script to add a date to each row of a csv.

    in Windows 10 Customization
    Powershell script to add a date to each row of a csv.: Hi all, struggling to get a powershell script working so I'm wondering if somebody would be kind enough to help, hopefully it's something simple but my experience with powershell isnt that great although I am learning heaps. I have a simple database (a csv file) called...
  8. Converting Excel Data to Powershell Script

    in Windows 10 Network and Sharing
    Converting Excel Data to Powershell Script: How would I go about converting Excel Data to Powershell Script? https://answers.microsoft.com/en-us/windows/forum/all/converting-excel-data-to-powershell-script/5c4fc5ae-3d65-4f9e-aef3-f6daad5910de"
  9. Understanding the Event Data of Event Viewer logs in XML format

    in AntiVirus, Firewalls and System Security
    Understanding the Event Data of Event Viewer logs in XML format: Hello, I'm trying to understand how to decode the %%-numbers present in some XML event data section. For example, in the eventID 5152, I have <EventData><Data Name='ProcessId'>0</Data><Data Name='Application'>-</Data><Data Name='Direction'>%%14592</Data><Data...
  10. xml

    in Windows 10 Customization
    xml: what is xml and how can I modify it. My windows media player was working alright then it stopped. When I did troubleshooting, I was told a software has changed the XML to SXL. Any help?...