-
Senior Member
Reputation: 487
CSV find value and delete row
Dear Experts,
do you know any tool or Access Query (script)
that can find specific value and delete all rows contains it
*CSV file is big in size and couldn't be open completely in Excel
Last edited by justdream; 2023-11-16 at 02:45 AM
-
2023-11-16 02:36 AM
# ADS
Circuit advertisement
-
VIP Member
Reputation: 1841
Re: CSV find value and delete row
Have you tried asking ChatGPT? It is usually very good at these things.
Here is an example when I asked your question (specific to MS Access)
In Microsoft Access, you can use a SQL `DELETE` query to delete rows that match a specific criterion. Here's an example of a query that deletes all rows where a specific field matches a certain value:
```sql
DELETE FROM YourTableName
WHERE YourFieldName = 'YourSpecificValue';
```
Replace `YourTableName` with the name of your table and `YourFieldName` with the name of the field you want to search for the specific value. Also, replace `'YourSpecificValue'` with the actual value you want to search for.
Here's an example with more concrete values:
```sql
DELETE FROM Customers
WHERE CustomerID = '123';
```
In this example, the query deletes all rows from the "Customers" table where the "CustomerID" field is equal to '123'.
Please be cautious when using `DELETE` queries, as they permanently remove data. It's a good practice to create a backup of your database before making significant changes.
Remember to run the query in SQL View of the Access Query Designer or directly in the SQL window in Access.
-
Post Thanks - 1 Thanks
-
Member
Reputation: 108
Re: CSV find value and delete row
windows = powershell. In the past, I have used the info in this weblink https://stackoverflow.com/questions/...tains-a-string
linux = grep with -v and pipe the output to a new file i.e. grep -v "text to exclude" filename > newfilename OR use AWK

Originally Posted by
justdream
Dear Experts,
do you know any tool or Access Query (script)
that can find specific value and delete all rows contains it
*CSV file is big in size and couldn't be open completely in Excel
-
Member
Reputation: 28
Re: CSV find value and delete row
Use pandas dataframe in python its very common this days, you can import the csv no matter the size in a dataframe and then simple search and delete. You can import it with method .from_csv and after manupilation you use method .to_csv and thats it. Lots of information on the internet/chatgpt
Bookmarks