Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need looping help

Status
Not open for further replies.

KiethBiasillo

Programmer
Jan 14, 2010
1
US
I have a source schema that can have 1-4 PID segments. However, I need my output to create 4 output records regardless of how many PID's there are. How can I simulate extra source hits.

source schema looks like:

PID
rec1desc
/PID
PID
rec2desc
/PID

target looks like

rec1
tag1 (TAGS ARE HARDCODED)
outputfield1
/rec1
rec2
tag2 (TAGS ARE HARDCODED)
outputfield2
/rec2
rec3
tag3 (TAGS ARE HARDCODED)
outputfield3
/rec3
rec4
tag4 (TAGS ARE HARDCODED)
outputfield4
/rec4

if input data looks like (notice only 2 records here)

pid
testing1
/pid
pid
testing2
/pid

then I need output to look like this:(notice the first value in this .csv output was the hardcoded tag value)

Description 1,testing1
Description 2,testing2
Description 3,
Description 4,

the final output file is positional by row so that is exactly why I need this many records generated. even though there were only two records, the last two just have empty values.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top