Forums Register Login

MultiLine Input/Output

+Pie Number of slices to send: Send
Hello,

I am trying to solve a problem where requirements are little vague and input could come as multiline like:
5 5
5 5 N
1 2 I

and I am doing some processing of the input using an algorithm and returning back the output also as multiline:
3 4
2 3

What is stopping me currently is that I am not able to figure out the best data structure to accept input and return output.
The program is not interactive and the multiline input comes in one shot and I need to return back multiline output in one shot after required processing is done.

I do not know if I should work with input/output as a String or with a file or is there a better way to handle this.
I would really like to seek ideas as to the best way to work with such examples of input/output.

If I do it using Strings, my program invoker really has to use \n characters in the input which does not look good to me.
If I do it using File, it might impact my program structure if I want to expose my service as remote service.
I know it is too basic but I would appreciate some ideas here..

thanks
It's a beautiful day in this neighborhood - Fred Rogers. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 937 times.
Similar Threads
TableModel using a HashMap<Integer, Room>
indexed and non-indexed input
Compiling blank lines patterns using regex
adding commas as thousands separators recursively
Web Service Program Design
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:02:58.