New Posts  All Forums:Forum Nav:

Edit it??

post #1 of 7
Thread Starter 
Hello,

i would like to make a batch file that removes lines 1-3 as well as all sentences starting with:

"StartMenuFolder"
"UninstallString"
"EXEStringM"
"QA"
"Techhelp"
"PatchLog"

in a text file called Keys.txt located in C:\\Keys.txt


If anyone can do this it would be reallllly awsuM! and +Rep for them!
Teh YayZors!
(13 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k 4.3GHz Gigabyte GA-P67A-UD4-B3 (Revision) AMD 6950 [unlocked to 6970] G.Skill RipJaws X 4GB (2 x 2GB) 1600mhz + Kings... 
Hard DriveOptical DriveOSMonitor
OCZ 460A 120GB SSD + 1TB 2x Optical  Windows 7 64-bit | Ubuntu 15.10 24" Samsung SyncMaster BX2450 
PowerCase
Corsair HX850W Coolermaster CM690 II Advanced 
  hide details  
Reply
Teh YayZors!
(13 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k 4.3GHz Gigabyte GA-P67A-UD4-B3 (Revision) AMD 6950 [unlocked to 6970] G.Skill RipJaws X 4GB (2 x 2GB) 1600mhz + Kings... 
Hard DriveOptical DriveOSMonitor
OCZ 460A 120GB SSD + 1TB 2x Optical  Windows 7 64-bit | Ubuntu 15.10 24" Samsung SyncMaster BX2450 
PowerCase
Corsair HX850W Coolermaster CM690 II Advanced 
  hide details  
Reply
post #2 of 7
Quote:
Originally Posted by [xPt]FLuX View Post
Hello,

i would like to make a batch file that removes lines 1-3...
call edlin from the batch file and use it to do the editing.
My System
(15 items)
 
  
CPUMotherboardGraphicsRAM
FX6300 Black M5A99X EVO R2.0 Nvidia GTS450 Team Vulcan PC3 12800 
Hard DriveOptical DriveCoolingOS
Samsung 840 PRO Asus DRW-1608P (x2) Custom Water Cooling Win7 (Ult), Win 8.1 & Win Server 2012 R2 
MonitorKeyboardPowerCase
2 X Samsung 915N Ducky Shine III, Blue Cherry/Blue LEDs PCP&C 1kw Lian Li PC-71 (W/Window) 
MouseAudio
Logiteck G400s none 
  hide details  
Reply
My System
(15 items)
 
  
CPUMotherboardGraphicsRAM
FX6300 Black M5A99X EVO R2.0 Nvidia GTS450 Team Vulcan PC3 12800 
Hard DriveOptical DriveCoolingOS
Samsung 840 PRO Asus DRW-1608P (x2) Custom Water Cooling Win7 (Ult), Win 8.1 & Win Server 2012 R2 
MonitorKeyboardPowerCase
2 X Samsung 915N Ducky Shine III, Blue Cherry/Blue LEDs PCP&C 1kw Lian Li PC-71 (W/Window) 
MouseAudio
Logiteck G400s none 
  hide details  
Reply
post #3 of 7
Go notepad, open Key.txt file.
Press Ctrl-H and replace window will appear then find this

"StartMenuFolder"
"UninstallString"
"EXEStringM"
"QA"
"Techhelp"
"PatchLog"

then replace it with nothing.
The golden rig
(15 items)
 
  
CPUMotherboardGraphicsRAM
Intel 6600K @ 4.7 GHz ASUS Z170 Pro Gaming AMD Sapphire Fury Nitro Crucial Ballistix Sport 8GB DDR4 
Hard DriveHard DriveCoolingCooling
Samsung 840 Series 120GB Solid State Drive  6TB Western Digital Blue Corsair H105 Hydro Series Antec 120mm Tricool fan (pinched from Antec 300... 
OSMonitorKeyboardPower
Windows 10 ViewSonic 23" IPS 2 ms monitor (VX2363SMHL-W) M... Ducky Shine 5 750 W StealthXStream (pinched from 2009 AMD rig) 
CaseMouse
Inwin 303 (White) Generic mouse 
  hide details  
Reply
The golden rig
(15 items)
 
  
CPUMotherboardGraphicsRAM
Intel 6600K @ 4.7 GHz ASUS Z170 Pro Gaming AMD Sapphire Fury Nitro Crucial Ballistix Sport 8GB DDR4 
Hard DriveHard DriveCoolingCooling
Samsung 840 Series 120GB Solid State Drive  6TB Western Digital Blue Corsair H105 Hydro Series Antec 120mm Tricool fan (pinched from Antec 300... 
OSMonitorKeyboardPower
Windows 10 ViewSonic 23" IPS 2 ms monitor (VX2363SMHL-W) M... Ducky Shine 5 750 W StealthXStream (pinched from 2009 AMD rig) 
CaseMouse
Inwin 303 (White) Generic mouse 
  hide details  
Reply
post #4 of 7
Quote:
Originally Posted by Console-hater View Post
Go notepad, open Key.txt file.
Press Ctrl-H and replace window will appear then find this

"StartMenuFolder"
"UninstallString"
"EXEStringM"
"QA"
"Techhelp"
"PatchLog"

then replace it with nothing.
Uh, how do you call notepad from a batch file?
My System
(15 items)
 
  
CPUMotherboardGraphicsRAM
FX6300 Black M5A99X EVO R2.0 Nvidia GTS450 Team Vulcan PC3 12800 
Hard DriveOptical DriveCoolingOS
Samsung 840 PRO Asus DRW-1608P (x2) Custom Water Cooling Win7 (Ult), Win 8.1 & Win Server 2012 R2 
MonitorKeyboardPowerCase
2 X Samsung 915N Ducky Shine III, Blue Cherry/Blue LEDs PCP&C 1kw Lian Li PC-71 (W/Window) 
MouseAudio
Logiteck G400s none 
  hide details  
Reply
My System
(15 items)
 
  
CPUMotherboardGraphicsRAM
FX6300 Black M5A99X EVO R2.0 Nvidia GTS450 Team Vulcan PC3 12800 
Hard DriveOptical DriveCoolingOS
Samsung 840 PRO Asus DRW-1608P (x2) Custom Water Cooling Win7 (Ult), Win 8.1 & Win Server 2012 R2 
MonitorKeyboardPowerCase
2 X Samsung 915N Ducky Shine III, Blue Cherry/Blue LEDs PCP&C 1kw Lian Li PC-71 (W/Window) 
MouseAudio
Logiteck G400s none 
  hide details  
Reply
post #5 of 7
Quote:
Originally Posted by billbartuska View Post
Uh, how do you call notepad from a batch file?
Pretty sure he's joking, but to start notepad it's "start notepad.exe"
Logic
(14 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K ASRock P67 Extreme4 Gen3 ASUS HD 7950 TWIN FROZR 3GB Corsair Vengeance 16GB DDR3-1600 
Hard DriveCoolingOSMonitor
Intel 330 120GB SSD + Spinpoint F3 1TB Corsair H60 Windows 7 Ultimate x64 Samsung 24.6" P2570HD 
KeyboardPowerCaseMouse
Filco Ninja Majestouch-2 Tenkeyless Antec EarthWatts 650W Corsair 600T Silver Logitech G500 
  hide details  
Reply
Logic
(14 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K ASRock P67 Extreme4 Gen3 ASUS HD 7950 TWIN FROZR 3GB Corsair Vengeance 16GB DDR3-1600 
Hard DriveCoolingOSMonitor
Intel 330 120GB SSD + Spinpoint F3 1TB Corsair H60 Windows 7 Ultimate x64 Samsung 24.6" P2570HD 
KeyboardPowerCaseMouse
Filco Ninja Majestouch-2 Tenkeyless Antec EarthWatts 650W Corsair 600T Silver Logitech G500 
  hide details  
Reply
post #6 of 7
Quote:
Originally Posted by wuddersup View Post
Pretty sure he's joking, but to start notepad it's "start notepad.exe"
Ok, but you can't issue any commands in notepad (from the original batch file) like you can in edlin.

Perhaps a command window and the FOR(-IN-DO) command would work for him.
My System
(15 items)
 
  
CPUMotherboardGraphicsRAM
FX6300 Black M5A99X EVO R2.0 Nvidia GTS450 Team Vulcan PC3 12800 
Hard DriveOptical DriveCoolingOS
Samsung 840 PRO Asus DRW-1608P (x2) Custom Water Cooling Win7 (Ult), Win 8.1 & Win Server 2012 R2 
MonitorKeyboardPowerCase
2 X Samsung 915N Ducky Shine III, Blue Cherry/Blue LEDs PCP&C 1kw Lian Li PC-71 (W/Window) 
MouseAudio
Logiteck G400s none 
  hide details  
Reply
My System
(15 items)
 
  
CPUMotherboardGraphicsRAM
FX6300 Black M5A99X EVO R2.0 Nvidia GTS450 Team Vulcan PC3 12800 
Hard DriveOptical DriveCoolingOS
Samsung 840 PRO Asus DRW-1608P (x2) Custom Water Cooling Win7 (Ult), Win 8.1 & Win Server 2012 R2 
MonitorKeyboardPowerCase
2 X Samsung 915N Ducky Shine III, Blue Cherry/Blue LEDs PCP&C 1kw Lian Li PC-71 (W/Window) 
MouseAudio
Logiteck G400s none 
  hide details  
Reply
post #7 of 7
If he wants to automate it, he doesn't want to edit it manually in a text editor anyway.

edlin is also not always available.

You can use "find" and "findstr" similar to how you would use "grep" on nix.

That means you can do things like this:

Code:
C:\\>type foo.txt
a
b
c
d
C:\\>findstr /v "b" foo.txt
a
c
d

That means you can do something like this:
Code:
findstr /v "StartMenuFolder UninstallString EXEStringM QA Techhelp PatchLog" keys.txt > cleankeys.txt

Not sure about removing the first 3 lines though. You could get gnuwin32 and use tail or something maybe but that's not ideal. They are ports of some Linux tools.

You may be able to use a batch for loop for this, counting each line and only printing it if the count is over 3.
Edited by ghell - 6/12/10 at 7:01am
Serene Power
(13 items)
 
  
CPUMotherboardGraphicsRAM
Dual Xeon E5620 Supermicro X8DAL-i EVGA 570HD SC 8GiB Corsair DDR3 1333 ECC-R 
Hard DriveOptical DriveOSMonitor
OCZ Agility 3 120GB SSD (+16TB NAS) LG 10x Blu-Ray Windows 7 x64 / Debian x64 Dell 2408WFP, P2411H 
PowerCase
850W CoolerMaster SilentPro M CoolerMaster Cosmos Pure 
  hide details  
Reply
Serene Power
(13 items)
 
  
CPUMotherboardGraphicsRAM
Dual Xeon E5620 Supermicro X8DAL-i EVGA 570HD SC 8GiB Corsair DDR3 1333 ECC-R 
Hard DriveOptical DriveOSMonitor
OCZ Agility 3 120GB SSD (+16TB NAS) LG 10x Blu-Ray Windows 7 x64 / Debian x64 Dell 2408WFP, P2411H 
PowerCase
850W CoolerMaster SilentPro M CoolerMaster Cosmos Pure 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming