I'm trying to do if the number doesn't exist in combined numbers then it should be dnc
I understand that, but $dnc retains the previous value you assigned every time through the loop, so I wonder if that's what you intended. If you move the declaration and assignment into the loop, $dnc will be an empty string unless the current number doesn't exist in combined numbers.
I don't know if that's what you want though.
| [reply] [d/l] [select] |
Yes, so that was probably the issue I was having. DNC isnt a column until we create it, so it should be an empty string unless the current number doesn't exist in combined numbers. Isn't it in the while loop though, the ending bracket for while loop is after that statement
| [reply] |
my $dnc_col = '';
while (my $row = $csv->getline($input))
Unless I misunderstand your intention, I think you should swap the order of these two lines.
| [reply] [d/l] |
Until this reply, I had no idea what you meant by DNC. I still don't know the significance of the other terminology, either, like "cleaned" or "combined". And without input or output I just kind of shrugged and moved on. You seem to assume we know something about these files you're processing.
I'd suggest restructuring the post to start with what you expect to accomplish with the code, a short example of input, the incorrect output you get now, and what correct output would look like. | [reply] |
Until this reply, I had no idea what you meant by DNC
A simple google would have told you that
DNC refers to either Democratic National Committee or District of North Carolina.
FDNC is easier, clearly referring to the fascinating book,
The Future Does Not Compute:
a philosophical exploration of some of the darker aspects of computers, with a probing emphasis on networked computers that mimic true communities. :)
| [reply] |
| [reply] |