Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.1K Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Create a growing Table with AppendTo?

Posted 9 years ago

I'm almost done my first program. Thanks in large part to the help I've received from the community. Thanks Guys. The last stupid piece that's giving me trouble is making a growing table with the AppendTo command.

my identify command links to another list of commands to give me input I'm adding to the table

identify = Flatten[ToExpression[Nearest[list, TextRecognize[im], 1]]]

gridlist = {"Name", "Date", "Informantion", "Number", "Refrence"}

addaline = AppendTo[gridlist, identify]

Text[Grid[gridlist, Frame -> All]]

Now, the problem is with the AppendTo command everything gets inputted before the first list ends. I need it to append after the list ends, to add another row to my gridlist.

Copied from the AppendTo link:

It's doing this

In[1 ] i = {1,2,4,9}; AppendTo[i,16]

Out[1 ] {1,2,4,9,16}

When I want it to do this

In[1 ] m = {{a, b}, {c, d}}; AppendTo[m, {e, f}]

Out[2]:= {{a,b},{c,d},{e,f}}

It's coming out as

{"Name", "Date", "Informantion", "Number", "Refrence",{"Tony Stark", "Jan 03 2017","Iron Man", "8.53", 
"Avengers 34"}}

and I don't know how to get it to come out as.

{"Name", "Date", "Informantion", "Number", "Refrence"},{"Tony Stark", "Jan 03 2017","Iron Man", "8.53", 
"Avengers 34"}

The difference being; one is a properly formatted grid command, the other is no. Now, I know the key line here is the addaline command. My first thought would be to evaluate the identify command but since it's refrencing another list of commands I don't know how to substitute it out, or turn it into a list before applying the AppendTo command... Help?

POSTED BY: Bill Norman
2 Replies
Posted 9 years ago

Yeah. The identify command reads the image and picks the appropriate command to run on the dynamic image "im" (each magazine has it's own crop coordinates), and in the end I'm going to Text[Grid[title, Frame -> All]] the whole thing.

POSTED BY: Bill Norman

That list thing is not valid Wolfram Language, But I guess you want something like:

identify = {"Tony Stark", "Jan 03 2017", "Iron Man", "8.53", "Avengers 34"}
gridlist = {"Name", "Date", "Informantion", "Number", "Refrence"}
addaline = {gridlist, identify}

giving:

{{Name,Date,Informantion,Number,Refrence},{Tony Stark,Jan 03 2017,Iron Man,8.53,Avengers 34}}
POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard