-2

I have a CSV file with many rows and columns (like an Excel file), I want a batch file that can find 'PaperCut Print Logger - http://www.papercut.com/' from first row-first column and if it exists, removed it.Also i want batch file makes a new CSV without that row and with other content. Also I want this file to be executed whenever a row is added to the table.

what can i do for that??? i want batch file coding.

this image is a part of my CSV file

Nakisa Ehsani
  • 23
  • 1
  • 3

1 Answers1

0

if you have to use Batch, there is a single command for that:

find /v "PaperCut Print Logger" <Input.csv > Output.csv

which will technically delete all lines, that contain the string PaperCut Print Logger, but I guess, that fits your needs.

makes a new CSV without that row and with other Content? new Content for the first line only?

echo this is the new first line>Output.csv
find /v "PaperCut Print Logger" <Input.csv >>Output.csv
Stephan
  • 53,940
  • 10
  • 58
  • 91
  • thanks for your answer, it works but not completely! Fine could remove my "PaperCut Print Logger" string but added 2 line new above all other data! (1 empty row and 1 row with #NAME?), i dont want these 2 too .how can remove them and make a new file without these tow row ??? – Nakisa Ehsani Jan 03 '16 at 05:34
  • oh sorry, my fault. Use a different method to give the file to `find`. See my edit. – Stephan Jan 03 '16 at 08:00
  • do you know how can i define a time schedule with Windows Time Scheduler that run my bat file every 30mins ??? – Nakisa Ehsani Jan 03 '16 at 08:16
  • [Start], enter `task Scheduler` into the search box (if you have an english Windows - and execute it. – Stephan Jan 03 '16 at 08:23
  • Yes I know this program, but i want to schedule my batch file to run every x-minutes. – Nakisa Ehsani Jan 03 '16 at 08:31
  • I found my resolve on this link http://stackoverflow.com/questions/4249542/windows-scheduler-to-run-a-task-every-x-minutes ThankXx – Nakisa Ehsani Jan 03 '16 at 08:36
  • [create Task] (not [create Basic Task]. Go to the [Triggers] tab, [New], "daily", "Repeat Task every:" – Stephan Jan 03 '16 at 08:36