http://qs321.pair.com?node_id=1186419


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

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

Replies are listed 'Best First'.
Re^7: Mapping & Hash Issues
by poj (Abbot) on Mar 29, 2017 at 19:38 UTC

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

    poj

      Hi Again

      My input file have

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

      My Mapping file have

      "C4000","A0000","C4910","A5854"

      My output file is getting generated after running your script is below, Ideally it should check "C4000","A0000" in mapping file if its there then has to update both with "C4910","A5854" for all the rows/line. What your script is doing its just updating the first Row and from second its just updating C4000 to C4910 but not updating A0000 to A5854. I dont have A4910 and A0000 combination in mapping file.

      If you are ok then can i send you a webex please so that you can take look ?

      "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

        Post the code you are using to get that output from that input

        poj
Re^7: Mapping & Hash Issues
by Anonymous Monk on Mar 29, 2017 at 19:21 UTC
    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?