0

I've got a custom HID device which prints out exact coordinates of touched points at real time.

It is very sensitive & currently printing out the coordinate that's being touched on multiple numbers. But I need them to be printed one event at a time.

The crucial point is that I need the events to be printed without gap.(none of the events could be omitted to be printed) and of course no delay is allowed.

Current Form:

A1
A1
A1
A2
A2
C3
C3
C3
C3
C3
D1
D1

What I expect is:

A1
A2
C3
D1
  • Just use uniq file.txt? – Sparhawk Jan 16 at 6:43
  • Please check that Olorin's edit is correct. Of course it is better to show the output in code blocks, but the edit also changed the output from A1 A1 A1 A2... in one long line to A1 A1 A1 A2 ... in separate lines. – Bodo Jan 16 at 9:14
  • @Bodo if you inspect the source of the original revision, it was one per line originally, but Markdown doesn't show it that way. – Olorin Jan 17 at 1:43
  • If uniq is working in a form of printing one from each type, then it won't work for my case. I need to just get the repetitive distinct touches as well. For example two different A1s can come one after. Or I need an exception handling mechanism in order not to send some wrong characters inside. So any ideas? – ybaylav Jan 18 at 9:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.