|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need Help W/ JScript
Here is what I have so far. What I'm trying to do is edit a large multipage *.PS file. %%BeginDocument is the top of the page and %%Trailer is bottom of the page. What I need is for the script to copy every thing betten the top and bottom of the page and out put it as a seperate file.
Any ideas. Please help me out Thx. var source_file_folder = ("C:\scripting\"); //Set to your own file structure var source_file_name_base = ("31286"); var source_file_name_extension = (".PS"); var output_file_name = ("addresslist.txt"); var input_line; var page = true; var d = new Date(); var count = 0; var line_test = /^%%BeginDocument/ FSO = new ActiveXObject("Scripting.fileSystemObject"); var log_file = FSO.CreateTextFile(source_file_folder + "log.txt", true); var output_file = FSO.CreateTextFile(source_file_folder + output_file_name, true); var input_file = FSO.GetFile(source_file_folder + source_file_name_base + source_file_name_extension); var input_file_stream = input_file.OpenAsTextStream(1); input_line = input_file_stream.ReadLine(); do { input_line = input_file_stream.ReadLine(); if (line_test.test(input_line)) { output_file.Writeline(input_line); count++; } else { } } while (!input_file_stream.AtEndOfStream); log_file.Writeline("Total records with bad addresses: " + count); input_file_stream.Close(); output_file.Close(); log_file.Close(); WScript.Echo("All Done"); |
|
#2
|
|||
|
|||
|
RE: Need Help W/ JScript
[moved to clientside]
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Need Help W/ JScript |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|