You guys are great! I used the sub-routine that KevinADC provided and it does exactly what I need to do.
There's only one thing i don't get about the code though. On the left side of the substitution you have:
@{[$i+1]}
I get that if it's not exactly like this it doesn't work, but what i...
Before anyone suggests it, i also tried changing the "change.defs" file to read:
B${1}_Y${2}_M${3} and B($1)_Y($2)_M($3)
thinking that it was the _ that was causing the problem. Still recieved the same error.
-B
I tried changing the regex substitution statement to be s///eeg, and s///ee, like mikedaruke suggested, and got this error:
Bareword found where operator expected at (eval 1) line 1, near "$1_Y"
(Missing operator before _Y?)
Bareword found where operator expected at (eval 1) line 1...
Sorry all, there was a mistake in my code when i tried to recreate the functionality (my actual code can't be posted). Here is code the recreates my problem and i don't know how to fix:
use DirHandle;
my $INAME = 0;
my $ONAME = 1;
my %changes = ();
my @line;
my $key;
my $old_file;
my...
Sure, I'll show you how I'm building the hash, if it'll help. Here goes:
my $INAME = 0;
my $ONAME = 1;
my %changes = ();
my @line;
my $key;
my $old_file;
my $new_file;
my $dirh = new DirHandle;
my @files;
open(FILE, "<change.defs");
while (<FILE>) {
@line = split(/\s+/, $_);
$key =...
I understand what you posted, but unfortunately it doesn't address my problem. The actual script won't have any knowledge prior to run-time of what pattern to match, nor what the new value will be. Therefore, there is no way to know just how many $1, $2..$n variables will be used. All of this...
I have a file which contains two columns. Column 1 is the pattern to match, column 2 contains the replacement pattern.
So:
B_(Stopp)_(\d{4})(\d{2})\d{2} B$1_Y$2_M$3
i want to do substitution using the interpolated varabiles in my code. I can get the pattern to match just fine, but when i...
Oh two more questions:
Is there a place or website out there that has the API for all Fortran's standard library functions?
did the READ() function specifications change from 32bit to 64bit.
-B
First some background:
Server type: unknown
OS: Sun Solaris 8
OS Support: sparcv9 & sparc
I converted this application from 32bit to 64bit. From what i can tell it compiles & links in 64 bit. (All the flags necessary for 64bit are being passed to compiler, ie: -xarch=v9 for CC/f77 & -64 for...
Ok, been frying my brain for a while now, so gonna ask for help.
Been asked to update this application from 32-bit to 64-bit. It uses something called Widgets and XtPointers. Now, i have no idea what they are and don't really care. The problem i have is when i try to compile the file i get the...
Thanks for the help sedj but one of my co-workers found the problem. I was missing this:
<%@ page isELIgnored="false" %>
Apparently my default value for ignoring the expression language is set to TRUE, therefore it wasn't doing the evaluation, it was printing litterals.
For some clarification, there are two errors in the code of my last post..
The line that says:
<HTML> if (dataBean.getloginStatus() == "false")
Ignore everything but the <HTML> tag.
and the line that says
<c:if test="${dataBean.loginStatus == 'true'}">
Yes it...
Here's some more info, may help you all to understand what I am trying to do:
<%@ page contentType="text/html" %>
<%@ page import="sod.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>...
When using <jsp:useBean> tag the first step the application server does is search the scope you specify for the appropriate bean. What exactly does it search in the scope? I mean if i specify:
<jsp:useBean id="myBean" scope="request" class="myPackage.myBeanClass">
Does it search the...
In IE if you use javascript to change the 'value' attribute of a <button> it works fine, even displays the new value on the button as it should. However this doesn't work in any other browser but IE..
Can anyone tell me how to get it to work, such as: Is there a different attribute i need to...
Basically what I am trying to do is remove bad information from a archived data file. The data files in the archive themselves are not multiple gb. But in order to get the data I need from them, i search this whole archive and pull back specific records inside each file and put them all into one...
PaulTEG,
Here's the error message I get when i try to use \P{IsASCII} in a regular expression and compare it to the character: ÿÿ
Malformed UTF-8 character (byte 0xff) in pattern match (m//) at ./por_auto_loader.pl line 727, <GEN2> line 22235.
Mikevh, where did you find that quote at?
B
Is there a simple way to pattern match for only those characters found on a standard US keyboard? Or must i type out each specific key (aside from the \w\s ones obviously).
I tried to use \p{IsASCII} but got back a very weird error message. Which, at this time i can not put into this post.
If...
According to everything I can find on the subject, if i were to open a file in mode +< I should be able to read the file, write to the file, and clobber existing (this i take to me overwrite current position of file).
Does this actually work? If so, is there a specific way you must reference...
Actually, you missed the point of the question. The crux of our problem is as follows:
We need to open 12 different files at the same time, sort through them and gather data in specific locations in each.
Since each file has the same structure, we want to do it in a loop.
What we ended up...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.