May-05-2022, 09:45 PM
So i have a csv file, and the data is structured like this
2022-04-25, 7:06 AM, bla bla bla
2022-04-25, 7:07 AM, ha ha ha
2022-04-25, 7:08 AM, ha ha ha
2022-04-25, 7:09 AM, ha ha ha
And so on..
I need to add a "delete" option that i can provide the date and time and have it find that line and delete it as well as everything above that line..
So if i provided:
2022-04-25, 7:07 AM
I want it to delete that line and all the lines above it so my file will end up with only
2022-04-25, 7:08 AM, ha ha ha
2022-04-25, 7:09 AM, ha ha ha
Im currently using these imports, can this be done with pandas?
import re
import pandas as pd
2022-04-25, 7:06 AM, bla bla bla
2022-04-25, 7:07 AM, ha ha ha
2022-04-25, 7:08 AM, ha ha ha
2022-04-25, 7:09 AM, ha ha ha
And so on..
I need to add a "delete" option that i can provide the date and time and have it find that line and delete it as well as everything above that line..
So if i provided:
2022-04-25, 7:07 AM
I want it to delete that line and all the lines above it so my file will end up with only
2022-04-25, 7:08 AM, ha ha ha
2022-04-25, 7:09 AM, ha ha ha
Im currently using these imports, can this be done with pandas?
import re
import pandas as pd