Connecting Tech Pros Worldwide Forums | Help | Site Map

there are 1500 set of binary vectors i have to append the vectors

Newbie
 
Join Date: Oct 2007
Posts: 11
#1: Oct 19 '07
suppose i have vectors... [1 0 0 0 0 ] , [1 1 0 0 0],[1 1 1 0 0] etc; and i have to add 1 0 0 at the beginnin of each of these vectors .... can u gimme idea abt how to proceed ....

numberwhun's Avatar
Site Moderator
 
Join Date: May 2007
Location: New Hampshire
Posts: 2,573
#2: Oct 19 '07

re: there are 1500 set of binary vectors i have to append the vectors


Quote:

Originally Posted by gayathrib1

suppose i have vectors... [1 0 0 0 0 ] , [1 1 0 0 0],[1 1 1 0 0] etc; and i have to add 1 0 0 at the beginnin of each of these vectors .... can u gimme idea abt how to proceed ....

Well, that is going to depend. Are the vectors in a file with each one on a line by itself? If so, you could take the file into an array, and then use a print statement outputting to a new file and print the prepended text before the existing with a concatenation (.) character between them. Its fairly simple.

Why not code it and if you have any issues, post the code up here (in code tags) and we can help with the troubleshooting of it.

Regards,

Jeff
Reply