Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

modifying csv/text file

Status
Not open for further replies.

bmclean2

MIS
Jul 20, 2005
22
0
0
US
I'm trying to open a comma separated text file which contains log data and I want to remove all blank lines. Additionally, if a particular line in the text file contains "administrator" or "administrators", I would like to delete that line from the file.

Is this possible? I have looked at the dictionary object but it seems to only allow add operations.

My overall goal is:
1. generate a csv file using an external program
2. scrub the csv file to remove blanks and references to admins as listed above
3. append the data to a database table

Thanks in advance...
 
Yes, what you will need to do is read the file, you can then go through each line and check for your values and write the data back to a variable or do nothing and move on to the next line.

I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top