Skip to main content
added 1 character in body
Source Link
terdon Mod
  • 252.2k
  • 3
  • 87
  • 143

In any case, bringing it here is a perfectly fine option, so here goes. The problem here was that you added ouryour own example data to the OP's question that did not actually match what the OP really had. This resulted in people wasting their time on data that don't represent what the OP was working on. This is what we had from the OP:

In any case, bringing it here is a perfectly fine option, so here goes. The problem here was that you added our own example data to the OP's question that did not actually match what the OP really had. This resulted in people wasting their time on data that don't represent what the OP was working on. This is what we had from the OP:

In any case, bringing it here is a perfectly fine option, so here goes. The problem here was that you added your own example data to the OP's question that did not actually match what the OP really had. This resulted in people wasting their time on data that don't represent what the OP was working on. This is what we had from the OP:

deleted 39 characters in body
Source Link
terdon Mod
  • 252.2k
  • 3
  • 87
  • 143

If you feel you have been ill-treated by me and if you, like you insinuate, believe that I have broken the code of conduct, then do not hesitate to contact a community manager, or bring it up in a post on our Meta site. (sourcesource)

If you feel you have been ill-treated by me and if you, like you insinuate, believe that I have broken the code of conduct, then do not hesitate to contact a community manager, or bring it up in a post on our Meta site. (source)

If you feel you have been ill-treated by me and if you, like you insinuate, believe that I have broken the code of conduct, then do not hesitate to contact a community manager, or bring it up in a post on our Meta site. (source)

Source Link
terdon Mod
  • 252.2k
  • 3
  • 87
  • 143

You weren't informed you "should" go to Meta, nor were you in any way requested to. You were told that you have multiple options when you disagree with moderator action and one of them is taking it to Meta:

If you feel you have been ill-treated by me and if you, like you insinuate, believe that I have broken the code of conduct, then do not hesitate to contact a community manager, or bring it up in a post on our Meta site. (source)

In any case, bringing it here is a perfectly fine option, so here goes. The problem here was that you added our own example data to the OP's question that did not actually match what the OP really had. This resulted in people wasting their time on data that don't represent what the OP was working on. This is what we had from the OP:

original image of data from OP

And this is what you added, based on what you imagined the OP's data would actually be:

date,edate,c1,c2,c3 s date1,e date1,c11,c22,c33
26-12-2022,26-12-2022,1,2,3 26-12-2022,26-12-2022,1,2,3
26-12-2022,26-12-2022,1,2,3 s date,edate,c1,c2,c3 s date1,e
date1,c11,c22,c33 26-12-2022,26-12-2022,1,2,3
26-12-2022,26-12-2022,1,2,3 26-12-2022,26-12-2022,1,2,3 

Desired output:

$ cat outfile s date  edate   c1  c2  c3 s date,edate,c1,c2,c3
26-12-2022,26-12-2022,1,2,3 26-12-2022,26-12-2022,1,2,3
26-12-2022,26-12-2022,1,2,3 26-12-2022,26-12-2022,1,2,3
26-12-2022,26-12-2022,1,2,3 26-12-2022,26-12-2022,1,2,3 

Yes, this is one possible way in which the OP's data might have been provided, but it is equally possible that the actual file was never an ASCII csv file but was a complex xml excel one. Or it could simply be that the fields were quoted. Or, as you yourself suggested in a comment, it could be a live connection to a database:

@roaima Yes, it seems to me that what the OP is seeing in Excel is a data connection to some database, not a text file, not even a plain worksheet. To change the data that such file presents, the database needs changing. That is not a simple task IMO, nor awk, sed or even perl or phyton will help. That is a task for someone that knows what an SQL query is. – QuartzCristal

Therefore, your adding your own version of the OP's data is not helpful and resulted in various people, including yourself, wasting their time trying to parse data that weren't actually what the OP had. Or, at best, data that we cannot be sure were what the OP had.

In fact, given that the OP later included another image, calling it "Actual file headers :", we can be pretty sure that your text version was not even close to what the OP had:

original headers

Which also explains why your answer naturally didn't work for them: they had very different data. This is why it is important to not try and put words into the OP's mouth. We try to never change the original data in a question since, unlike answers, we cannot be sure if this is actually what the OP has. Just like we might fix say indentation of a script in a question but would never correct the script's logic or fix any bugs since those could be relevant to the question.

So, in future, please don't change questions unless you are actually sure that you are correct. In cases where we need more data, it is better to wait until said data have been provided.