Jump to content
Macro Express Forums

Delete Rows from CSV


csharp
 Share

Recommended Posts

I have a macro that is copying files from a single location to multiple destinations that is working just fine. First it checks to see if the file exists, and skips it if it doesn't. If the file does exist, it will be copied to it's appropriate folder and then the original copy is moved to a "done" folder.

 

What I need your help with...if it finds the file and moves it, I would like it to delete the entire row from the csv file so that when we run the macro again, we won't have so many rows to go through. There are only two columns in the csv file, but there are over 6,000,000 rows, which is why we would like to eliminate as we go so there aren't so that this process will get faster the more times we run it.

 

 

<ADFBEG:F10:001:000001:000000:C:\EVrestore\homestore1\home1store1.csv><IFOTH:01:2:M:\recovery\dvs_2\%T1%><DOFILE:05:YY:M:\recovery\dvs_2\%T1%>%T2%%T1%><DOFILE:07:YY:M:\recovery\dvs\%T1%>M:\recovery\dvs_2\done\%T1%><ELSE><ENDIF><ADFEND>

Link to comment
Share on other sites

  • 1 month later...

I have a macro that is copying files from a single location to multiple destinations that is working just fine. First it checks to see if the file exists, and skips it if it doesn't. If the file does exist, it will be copied to it's appropriate folder and then the original copy is moved to a "done" folder.

 

What I need your help with...if it finds the file and moves it, I would like it to delete the entire row from the csv file so that when we run the macro again, we won't have so many rows to go through. There are only two columns in the csv file, but there are over 6,000,000 rows, which is why we would like to eliminate as we go so there aren't so that this process will get faster the more times we run it.

 

 

<ADFBEG:F10:001:000001:000000:C:\EVrestore\homestore1\home1store1.csv><IFOTH:01:2:M:\recovery\dvs_2\%T1%><DOFILE:05:YY:M:\recovery\dvs_2\%T1%>%T2%%T1%><DOFILE:07:YY:M:\recovery\dvs\%T1%>M:\recovery\dvs_2\done\%T1%><ELSE><ENDIF><ADFEND>

 

 

Sorry but not clear to me... I understand you want to reduce size of file but what exactly do you want to del in your csv file ?

To delete some lines, just use TEXT FILE PROCESS ....

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...