You are on page 1of 2

To remove the last part of string

string trim = a.Substring(0,a.Length - 4);

Get input file to and use it as file name in output file.

using System;

using mshtml;

using System.Text.RegularExpressions;

using VisualWebRipper.Internal.SimpleHtmlParser;

using VisualWebRipper;

public class Script

//See help for a definition of WrProjectInitializeArguments.

public static bool InitializeProject(WrProjectInitializeArguments args)

try

//Place your script code here.

var a = args.InputDataSource.FilePath.ToString();

var inputFileName = Regex.Match(a, @"\\.*?\.csv", RegexOptions.RightToLeft);

//var dayOfTheWeek = DateTime.Now.ToString("dddd");

var newpath = "C:\\Users\\Brett\\Documents\\Visual Web Ripper\\Output";

args.ExportDataConfiguration.FilePath = newpath + inputFileName;

return true;

catch(Exception exp)

args.WriteDebug("Custom script error: " + exp.Message);

return false;
}

You might also like