ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
FAQ Downloads Calendar Search Mark Forums Read

Q&A Using Flexsim and building models

Reply
 
Thread Tools Display Modes
  #1  
Old 10-09-2008
Ning Wang Ning Wang is offline
Flexsim User
 
Join Date: Apr 2008
Posts: 13
Downloads: 1
Uploads: 0
Thanks: 16
Thanked 1 Time in 1 Post
Rep Power: 142
Ning Wang is on a distinguished road
Default data import question

I want to import a 500*20 table into global table. The problem I'm facing now is that the format of original data is .txt and the original data is 20*500.
I was planning to import data into Excel first and transpose it. After that just import the 500*20 table from Excel.
BUT, the situation now is that excel has a column limitation for imported data which is 225. So I can't get the complete table.
Is there anyone having such kind of problem before? How can you solve it? Is there any suggestions?
Thanks

Ning
Reply With Quote
  #2  
Old 10-09-2008
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 679
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

Ning,

I would simply have 2 tables, one of 500 x 20 and one of 20 x 500. Then read in from excel and use for instance a resettrigger to have a small piece of code with a for loop in a for loop, and copy all data from 1 table to the next.

Ofcourse you can check up front if you have already done the copying and then don't do it anymore, or if it goes very fast, don't bother and do it every time.

Steven
Reply With Quote
The Following User Says Thank You to Steven Hamoen For This Useful Post:
Ning Wang (10-09-2008)
  #3  
Old 10-09-2008
Ning Wang Ning Wang is offline
Flexsim User
 
Join Date: Apr 2008
Posts: 13
Downloads: 1
Uploads: 0
Thanks: 16
Thanked 1 Time in 1 Post
Rep Power: 142
Ning Wang is on a distinguished road
Default

Thanks for response.
Can I read the data from .txt file? Becasue I can't get the complete table in Excel now since the original data has too much columns.
Reply With Quote
  #4  
Old 10-09-2008
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 325
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

Hi Ning,

If the text file is a comma separated file (CSV), you should be able to use the importtable command.

Lars-Olof
Reply With Quote
The Following User Says Thank You to Lars-Olof Leven For This Useful Post:
Ning Wang (10-09-2008)
  #5  
Old 10-09-2008
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 637
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

Hi Ning,

maybe the next code sample is a start to solve your problem:
string text;
fileopen("C:/Temp/test.txt","r");
for (int t=
1; t<=3;t++)
{
text=(
filereadline());
pt(text);pr();
pf(stringtonum(text));pr();
}
fileclose();

The textfile "test.txt" contains the following lines:

1 Hello
2 here
3 still here

The text is shown in the output console.
The commands for strings will maybe do the rest.

Otherwise you could write a small batch-file in DOS to format your file.

Jörg
Reply With Quote
The Following User Says Thank You to Jörg Vogel For This Useful Post:
Ning Wang (10-09-2008)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Data Import Sung Kim Q&A 2 07-16-2010 10:41 AM
how to import excel in source? qin tian Q&A 6 01-11-2010 10:58 PM
Import of data in schedule of a source Matthias Hofmann Q&A 3 10-07-2008 09:30 AM
Problems with import of data from a database Matthias Hofmann Q&A 1 09-26-2008 09:42 AM
Problems with Excel-Import tobias.biemueller Q&A 1 06-18-2008 06:17 AM


All times are GMT -6. The time now is 04:52 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.