cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NeerajYadav
Microsoft
Microsoft

How to remove multiple rows from csv file.

Hi All,

 

I have data in csv file as shown in below image.

I want to remove only those rows whose column's values are 0.

For example : Channel and MS having 0,0 records in both columns , so just need to remove both rows(Channel and MS) from csv.

Please help on this.

 

Summary5/14/20215/15/2021
individuals:79837983
Channel00
IR02
MS00
Duplicate43394339
Channel205
unsuppressed36433643

 

Thanks,

Neeraj

1 REPLY 1
WorkingForFood
Advocate V
Advocate V

Here's my suggestion:

  1. Get data from the CSV file using "Read from CSV file"
  2. Use a "For each" activity to iterate through each row in the dataset
  3. Use two "If" activities to determine if the two columns do not contain zero
  4. If both columns do not contain zero, add the row to a new dataset variable using "Set variable" activity
  5. After all rows have been tested, write the new dataset to a new CSV file using "Write to CSV file" activity. You could use this activity to replace your old file

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,810)