We help IT Professionals succeed at work.
Get Started

Modify Powershell script to report separate lines for a specific condition

130 Views
1 Endorsement
Last Modified: 2020-04-13
I would like to change the attached script to match the Desired Output.

When an "Item" which reports a "Part P on G",
and the same "Item" is found which shares the same "Code", then the "Item" and "Qty" which is reporting the "Part P on G"
must be reported on it's own line,  as shown in the "DesiredOutput" file.


For example in the Current Output file you will see:

3       744  12-12121   Desc2 8      0      1           2020/OC/03=744  

But the Desired Output must show it separately like this.

3       672  12-12121   Desc2 8      0      0           2020/OC/03=672
4        72  12-12121   Desc2 0      0      1           2020/OC/03=72

What change needs to be made to the script tp report it this way?
OldScript.ps1
Source.in
CurrentOutput.out
DesiredOutput.out
Comment
Watch Question
CERTIFIED EXPERT
Most Valuable Expert 2019
Most Valuable Expert 2018
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE