that got it thank you. I really wish I could wrap my head around arrays for things like this. Do you have a url or a book you could recommend, preferably a dummies version. thank you very much
here is what I did
# insert First Name
awk -F'|' '
FILENAME==ARGV[1] { firstname[$1,$2] = $3...
you are correct, the agent id's are unique for each office id.
the firstname[$14] is the actual position in the masterfile of the agent id. sorry not like in the example
this is what I came up with but the field is empty in mastefile_temp.txt
basically I'm just changing the array built up based...
I have two files that I would like to lookup id's for and add their corresponding values to the end of a master file. I can do this in Microsoft Access, but don't really want to.
The office file has a structure of Office ID|Office Name|Address|City|... etc.
The agent file has a structure of...
form_data is coming from db-lib.pl, and the program also uses cgi-lib.pl. I know, those programs are as old a dirt, but it has worked well for my requirements to this point.
For each row the current row shows when I print
print "$row\n";
which is what's expected at this point.
So what I'm...
I am attempting to print the results of an array, @database rows which shows the results of 5 records in my database. I need to populate showAddress with each record in the array to put those fancy markers in a google map. If I manually put showAddress in the spot below 5 times with 5 address...
Thank you so much, it's exactly the snippet I was looking for and I think I can even follow the logic. Not nearly as troublesome/cumbersome as I thought it would be.
I have a follow up question that has to do with the durability of the array. In a couple of circumstances fileb.txt could be...
I see another post that is almost what I'm looking for but thought I'd ask about my specific circumstance. Maybe between your input here and the other post I can figure out what I need.
I'd like to get away from using microsoft access to do these queries.
I know how to do this in a #!/bin/sh...
Using /bin/sh shell script. I have to pull fields from a bigger file, no problem there, I'm just clueless on adding something to the beginning and the end of a field.
I have a pipe delimited file as such: I'll only use one line for the example: 12345 will always match, as I'm just duplicating...
I did, I get a command not found.
I was even in the directory and just ran
ls ??-*.jpg | awk '{print mv" "$1" "substr($1,4)}' | sh
and I get the command not found???
I need to write a bash shell script to strip the first part of the filename in a directory of files.
The original filenames are
05-12345_1.jpg
05-12345_2.jpg
05-12345_3.jpg
06-56789_1.jpg
06-56789_2.jpg
06-56789_3.jpg
06-56789_4.jpg
etc.
I simply want to strip out the 05- or 06- whatever...
KevinADC
I got it figured out!
For what it's worth.
I added the three lines at the end of the routine you suggesed. I'm guessing that what it does is zero out the array from the results of the previous line.
I kept going over your comments and in looking at how some of the other code works in...
I really, really appreciate your taking the time to help me out.
It is an old script I picked up long ago and have been banging away at it. I've learned a little and as you can tell, I have a long way to go in my understanding of perl.
I couldn't find anything about payment in the rules, but I...
I need to clarify one thing.
I did not take out the # in the form_data statements.
If I add the # in the form_Data it gives me all the records.
here is what I have currently. I took the closing bracket } and moved it all the way to the bottom of the script.
open (KEYWORDFILE, "test.txt") ||...
I was messing with the chop vs chomp. It should be chomp no doubt.
You actually have me very close with your last suggestion.
I moved the } down to the very end of the script.
I'm now getting the three emails that I should, based on three lines in the test.txt.
What's weird is now it looks...
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.