Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: Mapping & Hash Issues

by sandeepsinghperl (Novice)
on Mar 29, 2017 at 17:29 UTC ( #1186403=note: print w/replies, xml ) Need Help??


in reply to Re^3: Mapping & Hash Issues
in thread Mapping & Hash Issues

First , thanks for being patient and youyr help. i ran the code its giving the below Error and nothing is coming up in the Target file.

=========================================================================================

C:\Users\sksingh>perl "C:\Users\sksingh\Documents\Barrick Work\Perl\GC +OA\newway.pl" "C:\Users\sksingh\Documents\Barrick Work\Perl\GCOA\NAAC +T.txt" "C:\Users\sksingh\Documents\Barrick Work\Perl\GCOA\NAACTDEPEND +.txt" "C:\Users\sksingh\Documents\Barrick Work\Perl\GCOA\FINALMAPDEPE +NDENT.txt" # CSV_XS ERROR: 2023 - EIQ - QUO character not allowed @ rec 1840 pos +12 field 1

=========================================================================================

Replies are listed 'Best First'.
Re^5: Mapping & Hash Issues
by Anonymous Monk on Mar 29, 2017 at 17:51 UTC
    First, <code> tags are easy to use. When you're entering your post, type something like this:
    <code>
    for my $i (1 .. 10) { print "And a $_,\n"; }
    </code>

    And it will come out looking nice. If you leave off the <code> and </code>, it will be all jumbled together and people will yell at you. Also, instead of typing a row of equal signs like you've been doing, you can instead use <hr>, which stands for horizontal rule.

    Second, as runrig says, there's probably something weird in your input file. Try looking at line 1840. Try making a smaller input file to make testing easier.

      The record number (1840) is inaccurate because it's counting the map file as well. You might want to put this line just above the start of the second while loop:
      $csv = Text::CSV->new({ auto_diag=>1, binary=>1, eol=>"\n" });
      (Yes, that's almost a copy of a previous line, but note that the my is missing.)
Re^5: Mapping & Hash Issues
by runrig (Abbot) on Mar 29, 2017 at 17:34 UTC
    Maybe there's something wrong with record 1840 in your input file?

      Hi

      My Input file is very small- 3 lines

      I updated the script by removing my. But it just updated the first row with correct Cocenter & Activity but Second Row it just updated the Costcenter but not the Activity. See below out file - first row is fine but second it should also update the Activity to A5854.

      "BegBalance" "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oc +t" "Nov" "Dec" "Period" ,,,,,,,,,,,,,,,,,, "FY01","HSP_InputValue","Local","Plan","Final","10","C4910","A5854","E +1900","52112",#Mi,1,2,3,4,5,6,7,8,9,10,11,12 "FY01","HSP_InputValue","Local","Plan","Final","10","C4910","A0000","E +1900","52122",#Mi,1,2,3,4,5,6,7,8,9,10,11,12

        Do you have CostCentre, Activity C4910,A0000 in your mapping file ?

        poj
        The first line isn't valid CSV, so I don't think you actually found it in the output file. Copy and paste error on your side?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1186403]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2022-10-04 16:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (18 votes). Check out past polls.

    Notices?