Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Need a fairly simple .bat file made
New Posts  All Forums:Forum Nav:

Need a fairly simple .bat file made - Page 2

post #11 of 16
Quote:
Originally Posted by Jiiks View Post

Yeah i wrote that quickly since he said it's always 8 lines tongue.gif What i meant is that your example left that part in while it should be removed, the block doesn't begin with "_vehicle"

ah yes. Go does some pretty odd stuff with regular expressions frown.gif

fixed now. will reupload the exe when i get chance
post #12 of 16
Quote:
Originally Posted by Plan9 View Post

ah yes. Go does some pretty odd stuff with regular expressions frown.gif

fixed now. will reupload the exe when i get chance

Ahh regex brings back the memories when i started parsing web pages, dealt with many headaches back then tongue.gif
Haswell
(21 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 4770K @ 4Ghz Gigabyte Z87X-UD5H Sapphire Radeon R9 290 Vapor-X G.Skill RipjawsZ 4x4GB 2400Mhz 
Hard DriveHard DriveHard DriveHard Drive
Crucial M4 126GB Crucial MX100 4x512GB WD Caviar Green EZRX Crucial M500 120GB 
Optical DriveCoolingOSMonitor
Samsung DVD Corsair Hydro H105 Windows 7 Ultimate Acer B276HK 
MonitorMonitorKeyboardPower
Dell P2314H Samsung SA700 Logitech G710+ Seasonic P-660 XP2 
CaseMouseMouse PadAudio
Fractal Design Arc Midi R2 Razer Deathadder 2013 Mionix Sargas 900 Asus Xonar DX/XD 
Audio
Beyerdynamics Custome One Pro White 
  hide details  
Reply
Haswell
(21 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 4770K @ 4Ghz Gigabyte Z87X-UD5H Sapphire Radeon R9 290 Vapor-X G.Skill RipjawsZ 4x4GB 2400Mhz 
Hard DriveHard DriveHard DriveHard Drive
Crucial M4 126GB Crucial MX100 4x512GB WD Caviar Green EZRX Crucial M500 120GB 
Optical DriveCoolingOSMonitor
Samsung DVD Corsair Hydro H105 Windows 7 Ultimate Acer B276HK 
MonitorMonitorKeyboardPower
Dell P2314H Samsung SA700 Logitech G710+ Seasonic P-660 XP2 
CaseMouseMouse PadAudio
Fractal Design Arc Midi R2 Razer Deathadder 2013 Mionix Sargas 900 Asus Xonar DX/XD 
Audio
Beyerdynamics Custome One Pro White 
  hide details  
Reply
post #13 of 16
Quote:
Originally Posted by Jiiks View Post

Ahh regex brings back the memories when i started parsing web pages, dealt with many headaches back then tongue.gif

Regex I'm fine with (Perl developer here). It's just Go doesn't seem to follow PCRE precisely - so when it doesn't, I'm left scratching my head. (on this occasion Go was going some weird stuff where it was swapping between lazy matching modes depending on the range to match mad.gif

Anyway. Code fixed, exe cross compiled and uploading it now....
[edit] do you mind editing your reply to take out the crap version in your quote?
Edited by Plan9 - 6/12/13 at 12:35pm
post #14 of 16
Thread Starter 
Wow, I go to bed and when I come back it seems like everyone was working on it a little bit. Just makes me wish I had a better understanding of all this.

Plan9, thanks for the command line version

and Jiiks, the .exe is exactly what I was looking for and a little more.

Thanks again!
RoG03
(19 items)
 
First Build
(21 items)
 
 
CPUMotherboardGraphicsRAM
i7 3770k Maximus V Gene z77 670 ftw g.skill 
Hard DriveHard DriveCoolingCooling
Samsung 630 Western Digital Blue EK Black Acetal Waterblocks CPU EK Black Acetal Waterblock GPU 
CoolingCoolingCoolingCooling
EK DDC X-RES Top 100 Swiftech MCP355 160mm Radiator 120mm Radiator 
OSMonitorKeyboardPower
Windows 8 BenQ XL2411T Razor Nostromo AX750 
CaseMouseMouse Pad
FT03 Razer Taipan Razor Sphex 
CPUMotherboardGraphicsGraphics
i7 3770k P6z68-V Pro EVGA 660ti EVGA 660ti 
RAMHard DriveHard DriveHard Drive
Corsair Vengence Samsung 830 Samsung 830 Samsung 830 
Hard DriveOptical DriveCoolingCooling
Western Digital Blue Asus 24x DVD burner Corsair H100 Antec Kuhler 620 
CoolingOSMonitorKeyboard
Antec Kuhler 620 Windows 8 Pro BenQ XL2411T Razor Nostromo 
PowerCaseMouseMouse Pad
Corsair TX750 NZXT Phantom 410 R.A.T. 5 Razor Sphex 
Audio
Logitech G35 
CPUMotherboardGraphicsRAM
Intel Core i5-3570K ASUS Maximus V Gene EVGA GTX 670 G.SKILL Ripjaws X Series 8GB 
Hard DriveOptical DriveCoolingOS
Western Digital WD Blue 1TB ASUS Black SATA 24X DVD Burner CORSAIR Hydro Series H60 Windows 7 Ultimate 
MonitorKeyboardPowerCase
ASUS VS Series VS238H-P Black 23" Microsoft Black USB Wired Slim Keyboard 600 CORSAIR Enthusiast Series TX650 V2 NZXT Crafted Series Vulcan Black 
MouseAudio
RAZER DeathAdder Logitech G35 
  hide details  
Reply
RoG03
(19 items)
 
First Build
(21 items)
 
 
CPUMotherboardGraphicsRAM
i7 3770k Maximus V Gene z77 670 ftw g.skill 
Hard DriveHard DriveCoolingCooling
Samsung 630 Western Digital Blue EK Black Acetal Waterblocks CPU EK Black Acetal Waterblock GPU 
CoolingCoolingCoolingCooling
EK DDC X-RES Top 100 Swiftech MCP355 160mm Radiator 120mm Radiator 
OSMonitorKeyboardPower
Windows 8 BenQ XL2411T Razor Nostromo AX750 
CaseMouseMouse Pad
FT03 Razer Taipan Razor Sphex 
CPUMotherboardGraphicsGraphics
i7 3770k P6z68-V Pro EVGA 660ti EVGA 660ti 
RAMHard DriveHard DriveHard Drive
Corsair Vengence Samsung 830 Samsung 830 Samsung 830 
Hard DriveOptical DriveCoolingCooling
Western Digital Blue Asus 24x DVD burner Corsair H100 Antec Kuhler 620 
CoolingOSMonitorKeyboard
Antec Kuhler 620 Windows 8 Pro BenQ XL2411T Razor Nostromo 
PowerCaseMouseMouse Pad
Corsair TX750 NZXT Phantom 410 R.A.T. 5 Razor Sphex 
Audio
Logitech G35 
CPUMotherboardGraphicsRAM
Intel Core i5-3570K ASUS Maximus V Gene EVGA GTX 670 G.SKILL Ripjaws X Series 8GB 
Hard DriveOptical DriveCoolingOS
Western Digital WD Blue 1TB ASUS Black SATA 24X DVD Burner CORSAIR Hydro Series H60 Windows 7 Ultimate 
MonitorKeyboardPowerCase
ASUS VS Series VS238H-P Black 23" Microsoft Black USB Wired Slim Keyboard 600 CORSAIR Enthusiast Series TX650 V2 NZXT Crafted Series Vulcan Black 
MouseAudio
RAZER DeathAdder Logitech G35 
  hide details  
Reply
post #15 of 16
Quote:
Originally Posted by Wicked x Josh View Post

Wow, I go to bed and when I come back it seems like everyone was working on it a little bit.

Yeah, don't get used to it as we're usually a miserable bunch. tongue.gif
post #16 of 16
Here's a quick program that does it: (C#)
Code:
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using System.Linq;
class A
{
        static void Main(string[] args)
        {
                if (args.Length < 2) return;
                Regex match = new Regex(@"_vehicle");
                List<string> results = new List<string>();
                results.Add("if (isServer) then {");
                results.AddRange(File.ReadLines(args[0]).Where(n => match.IsMatch(n)));
                results.Add("};");
                File.WriteAllLines(args[1], results);
        }
}

You'd pass it two arguments: the input file name, and the output file name.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Need a fairly simple .bat file made