Continual plotting of data from text file
I would like help with automated plotting of multiple sets of data on one axis. The file attached shows a sample of the data where the first number (eg 405) is the reference and the next two are the date and time. The data after that all needs to be plotted in a different color. The A.A.. (or .....) does not need to be plotted, the N/A's can be assumed to have either no reading or the same as the previous day. The data needs to be read from a text file and then graphed. The sample shows only a few variations and the reference number is incremented by 1 (I have shown random data) everytime the data is obtained from the source. Is this possible. If it is possible, the system will then need to be expandable to be able to updat
e the graphs daily as the new data is obtained (although this is not so important at the moment). Can anyone please help me with detailed instructions if possible. All help will be greatly appreciated.
Thanks
Nath
Attachments:
SAMPLE.txt 1 KB
I have written a rough vi for you in LV 6.0. Basically it shows how to open a file and write the string to an indicator. Then create an array from the numerical parts of the string which are plotted in a graph. I have assumed that the date/time and ref numbers will always be of the same format on each line of text.
I'm not sure if i have done exactly what you want, but should give you an idea of what to do. Let me know if you have any problems..
Kim
Attachments:
Create_graph_from_string.vi 51 KB
sample.txt 1 KB
Similar Messages
-
Cant get data from text file to print into Jtable
Instead of doing JDBC i am using text file as database. I cant get data from text file to print into JTable when i click find button. Goal is to find a record and print that record only, but for now i am trying to print all the records. Once i get that i will change my code to search desired record and print it. when i click the find button nothing happens. Can you please take a look at my code, dbTest() method. thanks.
void dbTest() {
DataInputStream dis = null;
String dbRecord = null;
String hold;
try {
File f = new File("customer.txt");
FileInputStream fis = new FileInputStream(f);
BufferedInputStream bis = new BufferedInputStream(fis);
dis = new DataInputStream(bis);
Vector dataVector = new Vector();
Vector headVector = new Vector(2);
Vector row = new Vector();
// read the record of the text database
while ( (dbRecord = dis.readLine()) != null) {
StringTokenizer st = new StringTokenizer(dbRecord, ",");
while (st.hasMoreTokens()) {
row.addElement(st.nextToken());
System.out.println("Inside nested loop: " + row);
System.out.println("inside loop: " + row);
dataVector.addElement(row);
System.out.println("outside loop: " + row);
headVector.addElement("Title");
headVector.addElement("Type");
dataTable = new JTable(dataVector, headVector);
dataTableScrollPane.setViewportView(dataTable);
} catch (IOException e) {
// catch io errors from FileInputStream or readLine()
System.out.println("Uh oh, got an IOException error!" + e.getMessage());
} finally {
// if the file opened okay, make sure we close it
if (dis != null) {
try {
dis.close();
} catch (IOException ioe) {
} // end if
} // end finally
} // end dbTestHere's a thread that loads a text file into a JTable:
http://forum.java.sun.com/thread.jsp?forum=57&thread=315172
And my reply in this thread shows how you can use a text file as a simple database:
http://forum.java.sun.com/thread.jsp?forum=31&thread=342380 -
Charting data from text file in LabVIEW 5.1 for Windows
I am having some difficulties trying to figure out how to plot a chart with
data from a file. I would like to be able to read data from a text file
into a chart using LabVIEW 5.1 for Windows. I have looked in the help
within the program and online. I have also looked in the user manual and
the book "LabVIEW for Everyone". Could you please give me specific
instructions on how I would construct the program to be able to do this.
Thank you.Hi Ellie,
It depends on how data is stored in that txt file. Usually you load the data into an array either using or , the array if necessary and send it to the graph indicator in required form. If you want a more detailed answer, send me a sample data file ([email protected]). -
Loading data from text file into ListBox
I have data in a text file that I want to load into a
listbox... I have fully mastered handling strings and arrays so I'm
going to need some help...
I was wondering how do I get flash to load a text file that
contains the data below.. and display it line for line like I want
it to list down the component
"Launch;7.1.7.6"
"Engine;7.1.7.6"
"OSX;7.0.0.2" (or something close to that)
and I was wondering how do i just get it to take it fromt he
file.. line for line from where it says exeversion in the file and
list it in the listbox...
I'm really thankful to anybody that helps.
Data in text file:
quote:
exeversion=Launch;7.1.7.6;
exeversion=Engine;7.1.7.6;
exeversion=LinuxX86;7.0.0.2;
exeversion=LinuxPPC;7.0.0.2;
exeversion=LinuxMIPS;7.0.0.2;
exeversion=OSX;7.0.0.2;
exeversion=Config;7.1.7.6;
exeversion=UI;7.1.7.7;
exeversion=JAVA;7.0.4.5;nobody cna help me? i really need to know or have a tutorial
or something so i can learn from it... i really appreciate anyone
who helps -
Unable to find file error while loading data from text file to Oracle
Hi,
I am having a interface where i am loading a data of Text file to Oracle.
But when i am trying to do this i am getting following error.
ODI-1227: Task SrcSet0 (Loading) fails on the source FILE connection SAPMM.
Caused By: java.sql.SQLException: File not found: d:/mdb/#General.get_filename
at com.sunopsis.jdbc.driver.file.FileResultSet.<init>(FileResultSet.java:160)
at com.sunopsis.jdbc.driver.file.impl.commands.CommandSelect.execute(CommandSelect.java:57)
at com.sunopsis.jdbc.driver.file.CommandExecutor.executeCommand(CommandExecutor.java:33)
SAPMM is connection name.
I am using get_filename to get the filename and it is fetching correct value as the this variable refreshes in previous step of this interface.
KM used for loading is File to SQL
What would be cause of this error?
Thanks,
MaheshHi,
Did a testing and following are the result
I have
A> created package having steps like
1. Declaration of variable v_filename.
2. Refreshing variable v_filename.
3. Execution of Interface which gets the file name from v_filename and load into target table
Package executes successfully.
B> created package having steps like
1. Declaration of variable v_filename.
2. Refreshing variable v_filename.
3. Scenario of Interface which gets the file name from v_filename and load into target table
Package executes with erre as it is not able to find the file
C> created package having steps like
1. Declaration of variable v_filename.
2. Refreshing variable v_filename.
3. Execution of Interface which gets the file name from v_filename and load into target table
4. Now create a scenario of the package , use the generated scenario in another package say main_package
Execution of main_package is successful.
Thanks,
Sutirtha -
How to extract data from text file to database table
Hi ,
I am trying to upload data in text file to database table using GUI_UPLOAD function .what would be the program for that.
thanks in advance.Hi,
I don't think you have a standard sap program to upload data from file to database table...
Instead you can create a custom program like this..
DATA: T_FILEDATA(1000) OCCURS 0 WITH HEADER LINE.
DATA: T_ZTABLE LIKE ZTABLE OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:\TEST.TXT'
tables
data_tab = T_FILEDATA
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT T_FILEDATA.
T_ZTABLE = T_FILEDATA.
APPEND T_ZTABLE.
ENDLOOP.
MODIFY ZTABLE FROM TABLE T_ZTABLE.
COMMIT WORK..
Thanks,
Naren -
CO-PA load data from text file
Hello
At present, in our company, we load data from Excel files to CO-PA. Is there any way to load those data to CO-PA from text files ?
I will be grateful for any suggestions.You can create a structure using KEFA, assign the Value fields in KEFB and then use KEFC to upload data against that structure.
You have various file format options, but I don't think Excel is one of them... you have have to save the file as txt and upload.
Play around with those transactions and come back if you need additional help.
Cheers. -
Unable to Upload data from text file into BEx Analyzer selection screen
Hi,
No response from BEx Analyzer when I am trying to upload around 40,000 material from text file into BEx Analyzer selection screen using "Upload selections" options. But I am able to upload only 10,000 material from text file. I never faced same kind of issue when I am using BEx Analyzer 3.x. Please let me know I have to change any settings related to BEx or any other.
Thanks
Sri Krishna Ponnada.Hello
It seems you are reaching the .NET memory limitation informed in note 1040454.
Because 3.5 does not use .NET it can work that.
Regards,
Ricardo -
Remove duplicates while loading data from text file
Hi,
Data in text file (some times has duplicates) is being loaded into Oracle 9i database using Informatica. To improve performance, we would like to remove duplicates at the time of each load using Oracle procedure. Could you please help me with this?
Thanks,
LakshmiNo, our table doesn't have that. Most of the functionality is managed at the informatica level. Is there any other way? Thanks,
-
Read data from text file one by one using for loop
Dear Forum
I want to read data of single colum of text file inside the for loop one by one(for each iteration value must be replaced by another value of text file).This value is used by a formula inside for loop. also after completion of iterations the values must be plotted on xy graph. How to do it.? please help me.
profraviIt's not very efficient to read a file line by line. Much simpler to read it all at once and then auto-index the results inside a for loop. The image below shows a generic solution to your problem. This assumes that the data in the file is in a single column.
I would also recomend checking ou the learning LabVIEW resources here.
I would aslos suggest that since this type of question is not specific to either NI-Elvis or the LabVIEW SE, you should post similar questions to the LabVIEW board. If you have problems, attaching a sample of the text file would help.
Message Edited by Dennis Knutson on 10-18-2007 09:11 AM
Attachments:
XY Graph From File.PNG 4 KB -
Read and average n data from text file
I acquire numeric data from the oscilloscope [reading a waveform] that is stored in one column in a text file.
I need to read in selectable amount of data points to average/plot them.
So basically I wanna have a text file with millions of data points but I wanna plot say only every 1000. data point. I have tried many things I found here on the forum but as I am new to LabView, none of them really worked.
Does anybody have a suggestion.
Thanks.
Solved!
Go to Solution.Hi,
among others I have tried to build the VI below but somehow I cannot get to the desired solution because according to the indicators it always stops after the first loop.
Can you have a look please?
Thanks.
Attachments:
read_and_average.vi 13 KB -
Error while loading the data from text file
Hi,
I got an error " Data Value Encountered before all Dimensions selected" while loading the data from the text file.
Can any one please suggest me the solution.Possible Solutions
Make sure that the data source is valid.
Is a member from each dimension specified correctly in the data source or rules file?
Is the numeric data field at the end of the record? If not, move the numeric data field in the data source or move the numeric data field in the rules file.
Are all members that might contain numbers (such as "100") enclosed in quotation marks in the data source?
If you are using a header, is the header set up correctly? Remember that you can add missing dimension names to the header.
Does the data source contain extra spaces or tabs?
Has the updated outline been saved? -
Hi there,
I am having a real battle trying to delete data from a text file I am using. There seems to be this giant cloud with Java, where there is no real easy way to delete text from a file??
I have a JFrame with two textfields on it where you enter the username and pcname. There is a OK button once you have entered those details.
On action event I would like those two details, to be removed from the text file that has been read in.
I have a text file like this:
bob
pc1
bill
pc2
The data above gets written no problem, one at at a time using the below.
File f = new File("\\c:\\filename.txt");
String strToWrite;
try
FileOutputStream fstr = new FileOutputStream(f);
strToWrite = username1+ '\r'+'\n' ;
byte[] bytes = strToWrite.getBytes(); fstr.write(bytes);
strToWrite = pcname1 + '\r'+'\n' ;
byte[] bytes2 = strToWrite.getBytes(); fstr.write(bytes2);
strToWrite = username2+ '\r' +'\n' ;
byte[] bytes3 = strToWrite.getBytes(); fstr.write(bytes3);
strToWrite = pcname2 + '\r'+'\n' ;
byte[] bytes4 = strToWrite.getBytes(); fstr.write(bytes4);
catch (IOException e)
System.out.println("Error -- " + e.toString());
To read them back in I have made the follwoing:
BufferedReader br= null;
Count = 0;
try
br = new BufferedReader(new InputStreamReader(new FileInputStream("\\c:\\filename.txt")));
String s = "";
while((s=br.readLine()) != null )
Count = 1;
//System.out.println("Data is " + s);
inboundtext = s;
if ( Count == 1 )
break;
while((s=br.readLine()) != null )
//System.out.println("Data is " + s);
inboundtext = s;
Count = 2;
if ( Count == 2 )
break;
catch(IOException ie)
finally
try
if(br!=null) br.close();
catch(Exception e)
Now the above I know, is reading each line of the text file one at a time.
Now what I would like is that when the text that we got from the textfields, using getText(), be removed from the file without destroying the rest of the records in there? Why is it so easy to add and replace files, but not do any deleting from them?
please help!!sorry, FileOutputStream fstr = new FileOutputStream(f);
should be FileOutputStream fstr = new FileOutputStream(f, true); -
How to save data from text file in databse for a transaction...
Hi Guys,
I have a text file which has some data related relevant to transaction VA01 separated by tabs.
Now instead of going in the transaction in VA01 and thne feeding the data manually, I would like this data
to get read automatically from the text file and get processed field by field for transaction VA01 and thne get saved.
How do I achieve this ? Do I have to use SHDB or some other method ?ahi tushar,
REPORT ZCALL_TRANS_TAB1 .
TABLES: LFA1,LFBK,lfb1.
*& internal table declaration
data: BEGIN OF it_vendor occurs 0,
LIFNR LIKE LFA1-LIFNR,
bukrs like lfb1-bukrs,
END OF it_vendor.
DATA: BEGIN OF IT_BANK occurs 0,
LIFNR LIKE LFA1-LIFNR,
BANKS LIKE LFBK-BANKS,
BANKL LIKE LFBK-BANKL,
BANKN LIKE LFBK-BANKN,
koinh like lfbk-koinh,
END OF IT_BANK.
data: it_bdcdata like bdcdata occurs 0 with header line.
data: it_messages like bdcmsgcoll occurs 0 with header line.
*selection screen.
selection-screen: begin of block b1 with frame.
parameters: p_file like rlgrap-filename default 'c:/vendor.txt'
obligatory.
parameters: p_file1 like rlgrap-filename default 'c:/xyz.txt'
obligatory.
selection-screen: end of block b1.
*at selection screen.
at selection-screen on value-request for p_file.
perform f4_help using p_file.
at selection-screen on value-request for p_file1.
perform f4_help1 using p_file1.
*start of selection
start-of-selection.
*******uploading file
perform upload_file using p_file P_FILE1.
******open session.
perform populate_data.
*& Form f4_help
text
-->P_P_FILE text
form f4_help using p_p_file.
data: l_file type ibipparms-path.
call function 'F4_FILENAME'
importing
file_name = l_file.
p_file = l_file.
endform. " f4_help
*& Form POPULATE_DATA
text
--> p1 text
<-- p2 text
form populate_data .
DATA: L_STRING TYPE STRing.
DATA: L_COUNTER(2) TYPE n.
loop at it_vendor.
perform bdc_dynpro using 'SAPMF02K' '0106'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-D0130'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
it_vendor-lifnr.
perform bdc_field using 'RF02K-BUKRS'
it_vendor-bukrs.
perform bdc_field using 'RF02K-D0130'
'X'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-bankn(03)'.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
******CALL TRANSACTION.
call transaction 'FK02' using it_bdcdata mode 'A'
messages into it_messages.
write:/ sy-subrc.
perform format_messages.
clear it_bdcdata.
refresh it_bdcdata.
endloop.
endform. " POPULATE_DATA
*& Form FORMAT_MESSAGES
text
--> p1 text
<-- p2 text
form format_messages .
data: l_msg(100).
loop at it_messages.
call function 'FORMAT_MESSAGE'
exporting
id = it_messages-msgid
lang = sy-langu
no = it_messages-msgnr
v1 = it_messages-msgv1
v2 = it_messages-msgv2
v3 = it_messages-msgv3
v4 = it_messages-msgv4
importing
msg = l_msg
exceptions
not_found = 1
others = 2
write:/ l_msg.
endloop.
endform. " FORMAT_MESSAGES
*& Form bdc_dynpro
text
-->P_0173 text
-->P_0174 text
form bdc_dynpro using value(p_program)
value(p_screen).
it_bdcdata-program = p_program.
it_bdcdata-dynpro = p_screen.
it_bdcdata-dynbegin = 'X'.
append it_bdcdata.
clear it_bdcdata.
endform. " bdc_dynpro
*& Form bdc_field
text
-->P_0178 text
-->P_0179 text
form bdc_field using value(p_fnam)
value(p_fval).
it_bdcdata-fnam = p_fnam.
it_bdcdata-fval = p_fval.
append it_bdcdata.
clear it_bdcdata.
endform. " bdc_field
*& Form upload_file
text
-->P_P_FILE text
-->P_P_FILE1 text
form upload_file using p_p_file
p_p_file1.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = P_P_FILE
FILETYPE = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = IT_VENDOR
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF sy-subrc <> 0.
MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
STOP.
ENDIF.
*******UPLOADING BANK DETAILS
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = P_P_FILE1
FILETYPE = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = IT_BANK
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF sy-subrc <> 0.
MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
STOP.
ENDIF.
endform. " upload_file
*& Form f4_help1
form f4_help1 using p_p_file1.
data:l_file1 type ibipparms-path.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = l_file1.
p_file1 = l_file1.
endform. " f4_help1 -
Screen data entry box that displays data from text file AND write back to file.
I want the user to be able to view/edit a 'setup file' FROM THE SAME INDICATOR BOXES for a application. I tried to read the file(text), display individual data in indicator boxes and re-write file when user is finished. This causes errors since you can't use indicators boxes as inputs for the file write. Is there some kind of indicator/control/data entry box that the user can view the data, edit the data, and re-write the data from the box???
hi
I have created this example for your reference.
I modified the Configuration File Examples in LV Examples, together with a few file check & create functions.
Hope this will help.
Note: The Configuration File Example from LV are COOL, indeed.
Cheers
ian.f
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010
依恩与LabVIEW
LVVILIB.blogspot.com
Attachments:
iFunc_Setup_Config_File.zip 102 KB
Maybe you are looking for
-
Acrobat Pro 9 will not color synchronize with CS5
Can anybody help with this issue. I am running the latest versions of CS5 Design Premium and all apps color sync fine from Bridge (and in bridge it says color is being synchronized) apart from Acrobat Pro. I have just updated to the latest version 9.
-
How to detect OS from within java?
hi, i have a method that reads all the classes in a directory. to do this i use the code File dir = new File(DIRECTORY_PATH); the variable DIRECTORY_PATH is a windows based directory path and so if i port my app to a mac it will not work 'cos of the
-
Video Conferencing with NX Pro?
Just got an NX Pro Webcam from my son and daughter-in-law for Christmas, and seem to have hooked it up without a problem. Can't figure out how to Video Conference with it, however. He has one as well, and that's what we'd like to be able to do. What
-
I have some Smart playlists in iTunes, but since some time ago, I can't creata a playlist based upon rating. The problem is, If I clic one star automatically shows 3, if I clic 2 iTunes set 4, and 5 instead of 3 stars. How can I fix this?? Im using i
-
Layout For Checks in Document Printing
Hello The output for Checks under Bankng-Document Printing-Checks for Payment is totally different from any of the layouts listed under Banking-Outgoing Payments-Checks For Payment.. How can I see the list or have access to what is used and change to