ATTENTIONThis 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 |
#1
|
|||
|
|||
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 |
#2
|
||||
|
||||
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 |
The Following User Says Thank You to Steven Hamoen For This Useful Post: | ||
Ning Wang (10-09-2008) |
#4
|
|||
|
|||
Hi Ning,
If the text file is a comma separated file (CSV), you should be able to use the importtable command. Lars-Olof |
The Following User Says Thank You to Lars-Olof Leven For This Useful Post: | ||
Ning Wang (10-09-2008) |
#5
|
||||
|
||||
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 |
The Following User Says Thank You to Jörg Vogel For This Useful Post: | ||
Ning Wang (10-09-2008) |
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 |