i am trying to get these 3 scripts to work together and having problems can some one point out where the hang up is -
open (IN, 'ALL_UIC.doc');
-
open (OUT,'>>UIC_1');
-
$outcount = 1;
-
-
while (<IN>) {
-
-
print OUT;
-
-
if ( $_=~/Performance of Duty for/ )
-
{
-
-
-
$UIC = substr $_, 42, 5; # extract the UIC for file name
-
-
}
-
-
if ( $_=~/Dollar value of unliquidated funds/ )
-
{
-
-
close (OUT,'>>UIC_$outcount');
-
-
-
rename ("UIC_$outcount","POD$UIC.doc");
-
-
$outcount++;
-
-
open (OUT,">>UIC_$outcount");
-
-
}
-
-
-
$dir="/home/grimp/test/"
-
opendir DIR $dir;
-
@files=readdir DIR;
-
closedir DIR;
-
-
foreach $file (@files) {
-
if (-f "$dir$file") { # true if $dir$file is a regular file
-
#move $file, mv POD*.doc /home/grimp/lougp
-
}
-
}
-
-
-
-
# Create a Zip file
-
use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
-
my $zip = Archive::Zip->new();
-
-
# Add a directory
-
#$dir_member = $zip->addDirectory( 'dirname/' );
-
-
-
# Add a file from disk
-
$file_member = $zip->addFile( 'POD*.doc' );
-
-
-
# Save the Zip file
-
unless ( $zip->writeToFileNamed('POD.zip') == AZ_OK ) {
-
die 'write error';
-
}
-
21 2264 numberwhun 3,509
Recognized Expert Moderator Specialist
Can you please provide a better explanation of exactly what the scripts are supposed to do and what you are seeing that isn't right or is erroring out?
Also, please use code tags around code you submit to the forums.
Regards,
Jeff
Can you please provide a better explanation of exactly what the scripts are supposed to do and what you are seeing that isn't right or is erroring out?
Also, please use code tags around code you submit to the forums.
Regards,
Jeff
ok i am new to programming and i am wanting to use the first script which works to break apart a large doc int smaller ones then i need to move the smaller docs to another dir and then zip the smaller docs into one zip file and is a code tag and html tag the same thing
numberwhun 3,509
Recognized Expert Moderator Specialist
ok i am new to programming and i am wanting to use the first script which works to break apart a large doc int smaller ones then i need to move the smaller docs to another dir and then zip the smaller docs into one zip file and is a code tag and html tag the same thing
First, thank you for your explanation, but it leaves a lot to wonder. Why don't you do all of your tasks in one script? Why break it up? Also, you have not mentioned what problems you are having with the script(s).
Regards,
Jeff
First, thank you for your explanation, but it leaves a lot to wonder. Why don't you do all of your tasks in one script? Why break it up? Also, you have not mentioned what problems you are having with the script(s).
Regards,
Jeff
oh sorry i can not get the files to move to a different directory have been able to get one to move but not all of them would not mind doing it all in one that is the big plan first i was trying to get the syntax right unix is different than dos not that i have a lot of edperiance there either
numberwhun 3,509
Recognized Expert Moderator Specialist
oh sorry i can not get the files to move to a different directory have been able to get one to move but not all of them would not mind doing it all in one that is the big plan first i was trying to get the syntax right unix is different than dos not that i have a lot of edperiance there either
To move files, you might want to read up on the File::Copy module. Also, you might want to read up on the perlfaq's over at perldoc.perl.or g as they provide a wealth of information on how to do some normal everyday things and would be really beneficial to you.
Regards,
Jeff
KevinADC 4,059
Recognized Expert Specialist
Your code is pretty confusing to me so I am unable to suggest changes or improvements. At a minimum this line looks wrong: - close (OUT,'>>UIC_$outcount');
should be: Icecrack 174
Recognized Expert New Member
for the actual move try this - $old = "$dir$file";
-
$new = "/home/grimp/lougp";
-
move($old, $new);
KevinADC 4,059
Recognized Expert Specialist
there is no move() function in perl. rename() actually moves a file, or there is the File::Copy module that has a move function. Its a standard perl module so should be installed.
numberwhun 3,509
Recognized Expert Moderator Specialist
there is no move() function in perl. rename() actually moves a file, or there is the File::Copy module that has a move function. Its a standard perl module so should be installed.
The move() function is a part of the File::Copy module that I pointed him to, but you are right, its not a built-in function.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Mike Daniel |
last post by:
I am attempting to use document.write(pageVar) that displays a new html page
within a pop-up window and the popup is failing. Also note that pageVar is
a complete HTML page containing other java scripts.
Being a javascript newbie and after significant testing, I suspect that the
document.write fails after finding a </script> within pageVar.
Does a trick exist that enables one to slightly alter pageVar whereby
enabling...
|
by: bayouprophet |
last post by:
Cant get menu script to to put linked page in the same frame. I am
new to Java
and I am wondering what am I doing wrong? below are my java applet
file, frame.html file, and my text file and one of my link file that
should load next to the menu on the same page. And Thank You in
advance.
Here is my menu applet:
<html>
|
by: Allen |
last post by:
I am trying to add an additional photo/hyperlink to the company web
site (I didn't create it) without any luck. The mouseover feature
'highlights' pics by swapping them with another pic using this command
in some type of array. I added the mailbox in the lower left corner
(see link below)http://www.aamechanical.com/indextemp.htm
but I cannot get it to swap. Here is the code for the page:
Thanks for your help in advance
|
by: Water Cooler v2 |
last post by:
Questions:
1. Can there be more than a single script block in a given HEAD tag?
2. Can there be more than a single script block in a given BODY tag?
To test, I tried the following code. None of the script gets executed.
Can someone please give me a direction as to what I may be missing?
Thanks.
|
by: bilaribilari |
last post by:
Hi all,
I am using Tidy (C) for parsing html pages. I encountered a page that
has some script as follows:
<script>
....
var abc = "<script>some stuff here</" + "script>";
....
</script>
| |
by: thisis |
last post by:
Hi All,
i have this.asp page:
<script type="text/vbscript">
Function myFunc(val1ok, val2ok)
' do something ok
myFunc = " return something ok"
End Function
</script>
|
by: rsteph |
last post by:
I have a script that shows the time and date. It's been working on my site for quite a while now. Suddenly it stops showing up, after getting my drop down menu to work.
If I put text between the <div id="datetime"></div> tags, the text shows up, but the javascript output being sent to those some divs doesn't seem to want to work. It should be showing up in the middle of the content pane, just below the first table box. (set by .css)
Here's...
|
by: Angus |
last post by:
I have a web page with a toolbar containing a Save button. The Save
button can change contextually to be a Search button in some cases.
Hence the button name searchsavechanges.
The snippet of html is:
<a class="searchsavechanges btn btn3d tbbtn" href="javascript:"
style="position:static">
<div id="TBsearchsavechanges">Search</div>
</a>
|
by: imtmub |
last post by:
I have a page, Head tag Contains many Scripts and style sheet for Menu and Page. This code working fine and displaying menus and page as i wanted.
Check this page for reference.
http://www.marco.com.cn/web-content/marco_re10.html
--------------------------------------------------------------
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Marco</title>
<!-- InstanceEndEditable -->
|
by: KevinADC |
last post by:
Note: You may skip to the end of the article if all you want is the perl code.
Introduction
Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script.
What You Need
Any recent...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |