Kevin,
The main problem is this. I will try to explain:
I have to change values in "FILE 2" based on what is found in "FILE 1"
FILE 1 contains a part number and price.
FILE 2 Needs to have the price updated based on what is found in file1.
FILE 1 simplified (Might actually contain 10K lines)...
I get this error:
Use of uninitialized value in join or string at C:\Program Files\LuckaSoft\EngInSite Perl Editor\Hash.pl line 17, <> line 4304.
What is wrong.. please
{
local @ARGV = ('C:/CNTWork/items1.csv');
local $^I = '.bac';
while(<>) {
chomp;
my @array =...
Hey I have been working with Perl for a few weeks now....
The portion between the colon's ":" Is the part number.
AYP :104757X421:
:104757X421:
Thanks for your response! I do appreciate it.
I can't wait to try your code. -D
What I need to do is to export a CSV file (see "FILE2 Example") and change the price of that part e.g. "2.64" to "3.28.
I have a list of 4000 parts that need to be compared with a file that might have 20K+ lines (New prices for parts).
What I was trying to do is create a "Hash" of FILE1...
I know this doesn't help but I am interested in this same solution.
I have
X,PRTNO, X,X,X,123
In file 1
File two has
PRTNO, 234
Where 234 is updating file 1.
So a person should get
X, PRTNO, X,X,X,234...
How do I get a value between two points on a line?
"BRG CALIF. 2 STAR 0000 00000000"
Point "A" is "BRG" point "B" is "0000"
I want to see everything between the "G and 0"
Less "G" and "0".
So what should be returned " CALIF. 2 STAR "
I can strip the spaces out myself...
I have a value and I want to know if it is a numeric value.
There isn't anything to test a value if it is truly numeric. Nothing is jumping out at me. I have been looking online for a while.
Douglas
Kevin
Yes thanks works great. (I am just stupid in perl. No... wait... just started in perl.)
Can you explain line 2 to me?
I understand that you are setting $t = <Rightside of =>
I tried just doing:
$r = [3];
print $r ;
that prints out Array(0xXXXX)
What's happening on that line?
What we need to understand is that the "Title" can be any length. So printing the array in the last response wont work.
I need something that finds the lenght of the string and removes the leading portion of the text.
e.g.
"Z BRG 100023 GASOHOL TEST KIT".
I know that "Z BRG 100023" array...
Sorry I left out a bunch of code and information.
I actual split this line before I get to this point
Where $line = Z BRG 100023 GASOHOL TEST KIT
$line = $_; #Set value of $line
$line =~ s/\s+/ /g; #Remove extra spaces
@array1 = split(/ /...
This is what I have below.
BRG 100023 GASOHOL TEST KIT
This is what I want:
GASOHOL TEST KIT
I can extract the BRG and 100023 but I need the "Title" of the product now.
@array("BRG 100023 GASOHOL TEST KIT");
print $array[1] . " " . $array[2]. " ". $array[3];
That would only get me
BRG 100023...
Below is a sample of the file I am importing. (FILE 1)
SAMPLE FILE 2 is what I am asking for help on.
SAMPLE FILE 2 is a representative of what I am asking for help on.
FILE 1 has six lines of data I want three.
Combine Line 1 with Line 2, Line 3 with Line 4, Line 5 with line 6.
This file is...
I have a file that has multiple lines exactly 4 lines per product.
I would like to combine every two lines into one line.
E BRG 100023 0000 00000545
Z BRG 100023 GASOHOL TEST KIT
The two lines below - The actual file has about 24,000 lines.
I have been...
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.