When the line are copied in the CSV, all the fields are separated with " tags. Is it possible to avoid it please?
When the append of the new 13 lines occurs I just want that these 13 lines crushed the previous existing 13 lines. So i want always 13 lines in my CSV file and not more
For 1)
Actually not. It’s part of the csv format definition and it identifies text. All tools or applications able to import or export csv files should be able to deal with it.
For 2)
You’ve got several code examples only one of it uses the parameter -Append. If you don’t like to append the new data don’t use it. You can use the parameter -Force to overwrite the exisiting file.
I was afraid that " syntax may cause issue and make the CSV file not recognized as a CSV file… For information I use the data of the CSV file with a BI tool
In the last script of Rob below there is not an append parameter. So I dont now how to force the overwriting??
and I would request you to use code posting tags(How to format code in this forum) to post code as it makes others easy to read and understand the code.
and for point 2: you can use -Force parameter of Export-CSv. you can do a Get-Help Export-CSV -Full for the documentation.
I have to echo what kvprasoon said … please please please use the code posting tags. You don’t even have to type them, you can click on them, they are named “pre” and you can find them right above the text you enter in the post editor.
I don’t know what’s your native language but in the code you posted you have twice an “append” in your comments!! If you don’t want to append the old data don’t do it
I would like to recommend for you to urgently start to learn the very basics of Powershell. What you’re asking here are beginner questions. You would save yourself from a lot of wasted time and frustrations.
Am I wrong or are you posting the same code again and again? Does the code do what you want? I have updated my code suggestion in my last post.
Please take your time and start to learn the basics of Powershell from scratch. You wull learn how to debug your scripts as well. Run your code line by line in the ise and check what’s in the variables you use.
No its not the same code, I added -Force parameter
But it doesnt do what I want
I doesnt understand why your code do nothing
And please understand that this specific scripts is urgent for me, I have not enough time to learn Powershell actually but it will better since one month…
To watch the MVA video course “Getting Started with Powershell” takes about 8 or 10 hours or so. I assume you would have time for this already.
It’s almost impossible that my code suggestion does “nothing”. No error? No messages in the console? Nothing? Did you try to debug it?
@rosse There is no benchmark for an individual about PowerShell knowledge. We all including you are learning it everyday, what @js was suggesting you is to have the very basics first. The video tutorial in Microsoft Virtual Academy(PowerShell 3.0 Jump Start) is just few hours. that will give you a lot of information.