Search found 6 matches

by jjcarranza
25 Oct 2012 09:39
Forum: DOS Batch Forum
Topic: How to remove specific text from a protocol file
Replies: 10
Views: 7868

Re: How to remove specific text from a protocol file

This works great for the example file however it doesn't work when entry to be deleted is located somewhere else. Do you think we can get rid of (NAME = YourFolder) entry when this is located anywhere on the file? Try this: @echo off for /f "delims=[]" %%a in ('find /n /v "" ^<f...
by jjcarranza
24 Oct 2012 11:32
Forum: DOS Batch Forum
Topic: How to remove specific text from a protocol file
Replies: 10
Views: 7868

Re: How to remove specific text from a protocol file

You're code looks great but I should have done something wrong since I'm receiving ">> was unexpected at this time." I have checked and it's in "if %%a LSS %top% >>"file2.txt" echo.%%b" line. I have tried over and over and I cannot find the solution. Did you copy and p...
by jjcarranza
23 Oct 2012 09:16
Forum: DOS Batch Forum
Topic: How to remove specific text from a protocol file
Replies: 10
Views: 7868

Re: How to remove specific text from a protocol file

This works with the sample text - it can be used with head and tail also, and sed, as it extracts the numbers of the lines to remove. Input file is file.txt Output is written to file2.txt Cons: it will corrupt the output if the line starts with a [ or ] character. @echo off for /f "skip=2 deli...
by jjcarranza
22 Oct 2012 10:51
Forum: DOS Batch Forum
Topic: How to remove specific text from a protocol file
Replies: 10
Views: 7868

Re: How to remove specific text from a protocol file

you want all the content of the file except this part (DESCRIPTION = (NAME = YourFolder) (PATH = C:\bach\path\home_2) (folder_name = MyFolder) ) is that right? and is it always had these lines in that order like: 0 line --> ( 1st Line --> (DESCRIPTION = 2nd Line --> (NAME = 3rd Line --> (PATH = 4th...
by jjcarranza
17 Oct 2012 14:14
Forum: DOS Batch Forum
Topic: How to remove specific text from a protocol file
Replies: 10
Views: 7868

How to remove specific text from a protocol file

Hey all, I have a protocol-kind-of file which contains some entries like these: WORLD = (DESCRIPTION = (DESC = (ADDRESS = (PROTOCOL = IPC)) (ADDRESS = (PROTOCOL = TCP)) ) ) SERVER_LIST = (LIST = (DESCRIPTION = (NAME = MyFolder) (PATH = C:\bach\path\home_1) (folder_name = MyFolder) (Other line) ) (DE...
by jjcarranza
22 Sep 2009 09:26
Forum: DOS Batch Forum
Topic: Script to check a file is not being written by a process
Replies: 0
Views: 4744

Script to check a file is not being written by a process

Hello experts,
I'm using a database backup utility that creates files with 1GB of information each. I want to move those files while utility is still running but I need to check if the file I'm about to move is not being written. Is there a way I can check so?
Thanks any hint will be appreciated!