Use only the first returned line from multiple output lines

(imported topic written by CiderMark)

I’m probably being completely thick here but, for the life of me, I can’t work out how to select only the first line of a non-unique object. i.e. the equivelant of ‘head -1’ in shell script.

I’m trying to use just the first line of the output from “addresses of adapters of network” but failing miserably.

Any help will be greatfully received.

Thanks, Mark.

(imported comment written by liuhoting)

I’m pretty sure I don’t have the right way to do this, but here’s a pretty cheesy way of doing what you want:

Q: ((addresses of adapters of network) as string)

A: 0.0.0.0

A: 0.0.0.0

A: 0.0.0.0

A: 0.0.0.0

A: 1.2.3.4

T: 18.604 ms

Q: concatenations “|||” of ((addresses of adapters of network) as string)

A: 0.0.0.0|||0.0.0.0|||0.0.0.0|||0.0.0.0|||1.2.3.4

T: 14.124 ms

Q: preceding text of first “|||” of concatenations “|||” of ((addresses of adapters of network) as string)

A: 0.0.0.0

T: 13.451 ms

Does that work?

(imported comment written by Lee Wei 2)

Sometimes I use this form, especially if we need to pick up a line further down from line 1.

tuple string item 0 of concatenation ", " of ((addresses of adapters of network) as string)

(imported comment written by CiderMark)

Thanks Lee - absolutely perfect solution.