Coder Social home page Coder Social logo

Removing Columns about rapidcsv HOT 12 CLOSED

jtaylorme avatar jtaylorme commented on July 24, 2024
Removing Columns

from rapidcsv.

Comments (12)

jtaylorme avatar jtaylorme commented on July 24, 2024 1

Thanks. Enjoy your vacation.

from rapidcsv.

jtaylorme avatar jtaylorme commented on July 24, 2024 1

Thank you VERY much. I will give it a whirl.

from rapidcsv.

jtaylorme avatar jtaylorme commented on July 24, 2024

I think it may also be removing the wrong column header, at times, and/or not removing the column header. I tried saving and reloading the csv file after 3-4 removals to overcome the problem but am getting errors about columns not existing, even though i hadn't removed them yet. When I look at the file I find headers I already deleted along with ones missing that I haven't deleted. Seems to add weight to my earlier guess.

jim

from rapidcsv.

jtaylorme avatar jtaylorme commented on July 24, 2024

As far as I can tell, deleting by Index works as expected. I tried deleting from left to right and right to left and both approaches worked.

Jim

from rapidcsv.

d99kris avatar d99kris commented on July 24, 2024

Thanks for reporting the issue. I'll try to look into this.

from rapidcsv.

jtaylorme avatar jtaylorme commented on July 24, 2024

Did some experimenting and as far as I can tell. It is keeping the original header list on RemoveCol. It removes the column in the data but if column names are being used it doesn't remove it from the header reference data. Didn't test row names but probably want to check that as well. I put in a message box and, for example, if Item# is in column 8 and I delete a couple of columns prior to column 8 and tell it to show what column Item# is in it still tells me it is in column 8. Hope this is accurate info and it helps. May also want to verify that Insert Column/Row is updating name reference data as well. Thanks again.

from rapidcsv.

jtaylorme avatar jtaylorme commented on July 24, 2024

Thought I had it fixed and was going to send code for what I did but I am apparently missing how the header names are maintained. I would remove the appropriate one but it wasn't changing the original, apparently, so it would come back with the original header mapping on the next Remove :-(

from rapidcsv.

d99kris avatar d99kris commented on July 24, 2024

I can also reproduce the problem and have some idea on how it can be fixed. I'm not sure when I can get it done though as I'm going for vacation this week and next, but will update here in case I get something in.

from rapidcsv.

jtaylorme avatar jtaylorme commented on July 24, 2024

Thought I had it fixed and was going to send code for what I did but I am apparently missing how the header names are maintained. I would remove the appropriate one but it wasn't changing the original, apparently, so it would come back with the original header mapping on the next Remove :-(

from rapidcsv.

d99kris avatar d99kris commented on July 24, 2024

The above commit should fix accessing by labels after document edit, such as insertion or removal of rows/columns. Let me know if there are still any issues relating to this. Thanks!

from rapidcsv.

jtaylorme avatar jtaylorme commented on July 24, 2024

As far as I can tell that did the trick. Haven't tried rows but column stuff seems to be in order now. Thanks again.

from rapidcsv.

d99kris avatar d99kris commented on July 24, 2024

Good to hear! 👍

from rapidcsv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.