Hi Ahmad,
Maybe something like this?
Method SetEncounter(line, ByRef newLine, ByRef remainder, pFileType, pLineNumber) As %Status {
Set tSC = $$$OK
Set tNewField = ""
For i=2:1:$LENGTH(line) {
Set word = $PIECE(line, "|", i)
If i=2 {Set newField = word}
Else {Set newField = newField_"^"_word}
If i>8 Quit // If you don;t care what happens with columns 9 and after
}
Set remainder = $PIECE(line, "|", 9, $LENGTH(line))
Set newLine = tNewField_"^"_remainder
Quit tSC
// Here we go through the line by examining each field of your column, starting with column 2. So we just build your output with each iteration. You probably have to save your original line and and grab the remainder from it to concatenate with new line
- Log in to post comments