This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Manfred please help

 
peter brews
Ranch Hand
Posts: 59
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for previous reply.I would appreciate if you help in making changes to the program below in order to get the following result:
field1[0]| val1|
field2[0]|val2|
|val3|
[5]|val4|
|val5|
|val6|
field3[2]|val1|
|val3|
|val4|
[5]|val5|

The required output is one object or vector or any other suitable data str per field
In a following way:
field1 index zero(the value in square bracket) should have value “val1”
field2 index zero(the value in sqaure bracket) should have value “va2”
field2 index one(the square bracket is absent, so value in above square bracket should be incremented by one) should have value “val3”
field2 index two should have value “null”
field2 index three should have value “null”
field2 index four should have value “null”
filed2 index 5 should have value “val4”
filed2 index 6 should have value “val5”
filed2 index 7 should have value “val6”
filed3 index zero should have value “null”
Filed3 index 1 should have value “null”
Filed3 index 2 should have value “val1”
Filed3 index 3 should have value “val3”
Filed3 index 4 should have value “null”
Field3 index 5 should have value “val5”
The program is :
package mypackage;

Thanks,
smita
edited by Dave to use code tags
[ February 12, 2002: Message edited by: Dave Vick ]
 
peter brews
Ranch Hand
Posts: 59
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please advise in making changes to the program below in order to get the following result:
field1[0]| val1|
field2[0]|val2|
|val3|
[5]|val4|
|val5|
|val6|
field3[2]|val1|
|val3|
|val4|
[7]|val5|
The required output is one object (or vector or any other suitable data str)per field
In a following way:
In vector:
Vector - field1( val1)
Vector field2(val2,val3,null,null,null,val4,val5,val6)
Vector field3(null,null,val1,val3,val4,null,null,val5)
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Smita,
Assuming you have given me the input.txt file. The following code should work.

Regards,
Manfred.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic