Convert data in the text file to table in DBL
Hi guys
I wanted to convert data in text file which are in multiple rows and columns in DBL format to a table to b seen in labview as DBL format.
I had tried looking and working at the example but in vain , i just cant produce anything
pls help. or write me a short example..thanks
Are you dealing with a table or an array. For an array, just use the Read spreadsheet file from the File I/O palette.
For a table, you will have to convert the number to a string and setting the appropriate precision and width, then write the 2-D string array to the table.
Message Edited by Ravens Fan on 05-20-2008 11:54 PM
Attachments:
Example_VI_BD6.png 3 KB
Similar Messages
-
How to do import data from the text file into the mathscript window?
Could anyone tell me how to do import data from text file into mathscript window for labview 8?
MathScript Window openned, File, Load Data - it has options: custom pattern (*.mlv) or all files.
ThanksHi Milan,
Prior to loading data in Mathscript Window , you have to save the data from the Mathscript window (the default extension of the file is .mlv but you can choose any extension). This means that you cannot load data from a text file that was not created using the Mathscript window.
Please let me know if you have any further questions regarding this issue.
Regards,
Ankita -
Hi Everyone,
I am new to Oracle forms. I have a requirement where user wants a form which can be used to browse a excel file from his/her system. Also after browsing the file the user should be able to load the data from the file to a table in the Oracle DB.
Any help pointers would be appreciated.
Thanks,
Satya
Message was edited by: user12098633Hi Marcus,
I am using EBS (E- Business Suite) ERP and version is 11.5.10.2
My database version is as below
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE
11.2.0.3.0
Production
TNS for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
I want to move csv file via EBS only. Average size of this will be max 600-700 bytes.
Program should be in pl/sql package or concurrent program or custom .fmb (d2k forms) or custom .rdf (d2k report) or through alert. I am not using samba. -
Insert data to MySQL when there is new data in the text file
I have one log file, the log file will update its data (alarm type & datetime) when there is alarm. If I would like to write program to monitor the log file every minute, and insert the data to mysql when there is a new data in log file. Any Idea how to use java to write it ?
Thanks !imagination21 wrote:
Any Idea how to use java to write it ?Yes. But do you have a specific question? What's the problem? -
How to extract different date format in text file
well, iam new for using regex api(regular expression), In my project i want to extract the different format of date from the text file... date format will be 3rd june 2004, 03-06-2004, june 3rd and so on....
can any body give me regular expression to extract the date from the text file...
i will be very grateful..
kareemdate format will be 3rd june 2004, 03-06-2004, june 3rd and so on....The only way to do this (without implementing a "mind reader") is to determine in advance all the possible date formats that are possible in your input, and try to interpret each date using each of those formats until one of them passes.
It's easy enough to handle june 3rd vs 3 june vs 3rd june, but 6/3 vs 3/6, of course, is ambiguous. -
How can I use Automator to extract specific Data from a text file?
I have several hundred text files that contain a bunch of information. I only need six values from each file and ideally I need them as columns in an excel file.
How can I use Automator to extract specific Data from the text files and either create a new text file or excel file with the info? I have looked all over but can't find a solution. If anyone could please help I would be eternally grateful!!! If there is another, better solution than automator, please let me know!
Example of File Contents:
Link Time =
DD/MMM/YYYY
Random
Text
161 179
bytes of CODE memory (+ 68 range fill )
16 789
bytes of DATA memory (+ 59 absolute )
1 875
bytes of XDATA memory (+ 1 855 absolute )
90 783
bytes of FARCODE memory
What I would like to have as a final file:
EXCEL COLUMN1
Column 2
Column3
Column4
Column5
Column6
MM/DD/YYYY
filename1
161179
16789
1875
90783
MM/DD/YYYY
filename2
xxxxxx
xxxxx
xxxx
xxxxx
MM/DD/YYYY
filename3
xxxxxx
xxxxx
xxxx
xxxxx
Is this possible? I can't imagine having to go through each and every file one by one. Please help!!!Hello
You may try the following AppleScript script. It will ask you to choose a root folder where to start searching for *.map files and then create a CSV file named "out.csv" on desktop which you may import to Excel.
set f to (choose folder with prompt "Choose the root folder to start searching")'s POSIX path
if f ends with "/" then set f to f's text 1 thru -2
do shell script "/usr/bin/perl -CSDA -w <<'EOF' - " & f's quoted form & " > ~/Desktop/out.csv
use strict;
use open IN => ':crlf';
chdir $ARGV[0] or die qq($!);
local $/ = qq(\\0);
my @ff = map {chomp; $_} qx(find . -type f -iname '*.map' -print0);
local $/ = qq(\\n);
# CSV spec
# - record separator is CRLF
# - field separator is comma
# - every field is quoted
# - text encoding is UTF-8
local $\\ = qq(\\015\\012); # CRLF
local $, = qq(,); # COMMA
# print column header row
my @dd = ('column 1', 'column 2', 'column 3', 'column 4', 'column 5', 'column 6');
print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
# print data row per each file
while (@ff) {
my $f = shift @ff; # file path
if ( ! open(IN, '<', $f) ) {
warn qq(Failed to open $f: $!);
next;
$f =~ s%^.*/%%og; # file name
@dd = ('', $f, '', '', '', '');
while (<IN>) {
chomp;
$dd[0] = \"$2/$1/$3\" if m%Link Time\\s+=\\s+([0-9]{2})/([0-9]{2})/([0-9]{4})%o;
($dd[2] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of CODE\\s/o;
($dd[3] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of DATA\\s/o;
($dd[4] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of XDATA\\s/o;
($dd[5] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of FARCODE\\s/o;
last unless grep { /^$/ } @dd;
close IN;
print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
EOF
Hope this may help,
H -
How To Re-Input More Data To A Text File?
I was wondering if anyone could tell me how to re-input more data into a text file? I don't want to over-write the text file, but just add more data to it. The current code i have is:
import java.util.Scanner;
import java.io.*;
class trialanderror002 {
public static void main(String args[]){
Scanner input = new Scanner(System.in);
String str;
FileOutputStream out;
PrintStream p;
try{
out = new FileOutputStream("c:\\products.txt");
p = new PrintStream(out);
System.out.println("Please insert text to be written to file...");
str = input.next();
p.println (str);
p.close();
catch (Exception e){
System.err.println ("Error writing to file");
Basically, after each time the program is ran, i'd like to insert another line of data into products.txt.
Is there a way for me to loop the program too and not remove the data from the text file?
thanx...just one more question...
i've figured out the code to retrieve the text file and print it to screen...but how do i go about only printing parts of my text file?
So supposing my text file has 5 lines of data/text etc, how would i make it print the first line?...or the second line?...or the third....etc etc...
the current code i now have is:
package Assignment1;
import java.util.Scanner;
import java.io.*;
class trialanderror002 {
public static void main(String args[]){
Scanner input = new Scanner(System.in);
String str;
FileOutputStream out;
PrintStream p;
try{
out = new FileOutputStream("c:\\trial.txt", true);
p = new PrintStream(out);
System.out.println("Please insert text to be written to file...");
str = input.next();
p.println (str);
p.close();
catch (Exception e){
System.err.println ("Error writing to file");
try {
FileReader file = new
FileReader("c:\\trial.txt");
BufferedReader buff = new
BufferedReader(file);
boolean eof = false;
while (!eof){
String line = buff.readLine();
if (line == null)
eof = true;
else
System.out.println(line);
buff.close();
}catch (IOException e){
System.out.println("Error -- " + e.toString());
} -
Loading the data from a text file to a table using pl/sql
Hi Experts,
I want to load the data from a text (sample1.txt) file to a table using pl/sql
I have used the below pl/sql code
declare
f utl_file.file_type;
s varchar2(200);
c number := 0;
begin
f := utl_file.fopen('TRY','sample1.txt','R');
loop
utl_file.get_line(f,s);
insert into sampletable (a,b,c) values (s,s,s);
c := c + 1;
end loop;
exception
when NO_DATA_FOUND then
utl_file.fclose(f);
dbms_output.put_line('No. of rows inserted : ' || c);
end;
and my sample1.txt file looks like
1
2
3
The data is getting inserted, with below manner
select * from sampletable;
A B C
1 1 1
2 2 2
3 3 3
I want the data to get inserted as
A B C
1 2 3
The text file that I have is having three lines, and each line's first value should go to each column
Please help...
Thanksdeclare
f utl_file.file_type;
s1 varchar2(200);
s2 varchar2(200);
s3 varchar2(200);
c number := 0;
begin
f := utl_file.fopen('TRY','sample1.txt','R');
utl_file.get_line(f,s1);
utl_file.get_line(f,s2);
utl_file.get_line(f,s3);
insert into sampletable (a,b,c) values (s1,s2,s3);
c := c + 1;
utl_file.fclose(f);
exception
when NO_DATA_FOUND then
if utl_file.is_open(f) then utl_file.fclose(f); ens if;
dbms_output.put_line('No. of rows inserted : ' || c);
end;SY. -
What is the best way to load and convert data from a flat file?
Hi,
I want to load data from a flat file, convert dates, numbers and some fields with custom logic (e.g. 0,1 into N,Y) to the correct format.
The rows where all to_number, to_date and custom conversions succeed should go into table STG_OK. If some conversion fails (due to an illegal format in the flat file), those rows (where the conversion raises some exception) should go into table STG_ERR.
What is the best and easiest way to archive this?
Thanks,
Carsten.Hi,
thanks for your answers so far!
I gave them a thought and came up with two different alternatives:
Alternative 1
I load the data from the flat file into a staging table using sqlldr. I convert the data to the target format using sqlldr expressions.
The columns of the staging table have the target format (date, number).
The rows that cannot be loaded go into a bad file. I manually load the data from the bad file (without any conversion) into the error table.
Alternative 2
The columns of the staging table are all of type varchar2 regardless of the target format.
I define data rules for all columns that require a later conversion.
I load the data from the flat file into the staging table using external table or sqlldr without any data conversion.
The rows that cannot be loaded go automatically into the error table.
When I read the data from the staging table, I can safely convert it since it is already checked by the rules.
What I dislike in alternative 1 is that I manually have to create a second file and a second mapping (ok, I can automate this using OMB*Plus).
Further, I would prefer using expressions in the mapping for converting the data.
What I dislike in alternative 2 is that I have to create a data rule and a conversion expression and then keep the data rule and the conversion expression in sync (in case of changes of the file format).
I also would prefer to have the data in the staging table in the target format. Well, I might load it into a second staging table with columns having the target format. But that's another mapping and a lot of i/o.
As far as I know I need the data quality option for using data rules, is that true?
Is there another alternative without any of these drawbacks?
Otherwise I think I will go for alternative 1.
Thanks,
Carsten. -
Saving data retrieved from text file to JDBC table
Hi,
I would like to save data, loaded from a text file to a dataset, into an existing JDBC table.
The documentation I found on this subject is very brief, and no matter how I tried, I couldn't succeed.
I would appreciate any help.
Thank you in advanceHi there,
Here is an example of reading a String and a date from a text file. Once you have what you need in the Strings (or whatever) it should be easy to insert them into and SQL statement. Let me know if you need an example of this as well and I'll post it in the morning. Right now I'm off to bed :o)
Cheers
Mark
import java.io.*;
import java.util.*;
import java.text.*;
public class WriteTest {
public static void main(String [] arg) throws Exception {
Date today = new Date();
String name = "";
SimpleDateFormat formatter = new SimpleDateFormat("ddMMyyyy");
File myfile = new File("hello.txt");
// how to input
BufferedReader in = new BufferedReader(new FileReader(myfile));
String name="",
date="";
boolean eof = false;
do {
name = in.readLine();
date = in.readLine();
if(!(eof = (name==null || date==null)))
System.out.println(name+" "+formatter.parse(date));
while(!eof);
} -
How to get data of tabulated text file into internal table
hi all,
i want to get data from tabulated text file(notepad) into internal table. i searched in SCN and got lot of post regarding how to convert excel file into internal table but i didnt get posts regarding text file.
thanks
SAchintry:
DATA: BEGIN OF tabulator,
x(1) TYPE x VALUE '09',
END OF tabulator.
READ DATASET file INTO wa.
split wa at tabulator into table itab.
A. -
Is there away to load data from a text file to a table?
I have data stored in filename.txt and I want to load those data into a table on the front pannel of vi. How can I do that?
Se;
If the text file is already in an spreadsheet format, you can download the VI Read Strings From Spreadsheet File from my website:
http://www.jyestudio.com/lview.shtml
It is the suggested modification of the VI Read From Spreadsheet File that comes with LabVIEW, as stated in the diagram.
If the text file is not in spreadsheet format, then you need to write your own code to make the string table suitable for the table.
Regards;
Enrique
www.vartortech.com -
Data transfer from text file to internal table
Hi, i am uploading data from a text file to an internal table itab.
one of the field in the text file is in the format of p(7,2).
while uploading , this is not not getting uploaded correctly,
for ex instead of uploading 00008.00 in the itab, it gives a strange value of 30303030382>3.03. how to correct this?
pls helpHello Rahul,
Do the following:
types: begin of ty_upload,
string type string,
end of ty_upload.
types: begin of ty_fields,
text1(20),
wert type p decimals 2,
text2(20),
end of ty_fields.
data: it_upload type table of ty_upload,
it_fields type table of ty_fields,
wa_upload type ty_upload,
wa_fields type ty_fields.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:\aa_upload.txt'
FILETYPE = 'ASC'
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = it_upload
EXCEPTIONS
FILE_OPEN_ERROR = 1
Populate the internal table it_fields accordingly in a loop run, e.g.
loop at it_upload into wa_upload.
wa_fields-text1 = wa_upload-string(20).
wa_fields-wert = wa_upload-string+20(10).
wa_fields-text2 = wa_upload-string+30.
append wa_fields to it_fields.
endloop.
When your offsets are set correctly, there shouldn't be any problem.
Regards,
Heinz -
I would like to plott data from a text file in the same way as a media player does from a video file. I’m not sure how to create the pointer slide function. The vi could look something like the attached jpg.
Please, can some one help me?
Martin
Attachments:
Plotting from a text file like a media player example.jpg 61 KBHI Martin,
i am not realy sure what you want!?!?
i think you want to display only a part of the values you read from XYZ
so what you can do:
write all the values in an array.
the size of the array is the max. value of the slide bar
now you can select a part of the array (e.g. values from 100 to 200) and display this with a graph
the other option is to use the history function of the graphes
regards
timo -
How can I save images and text data to the same file?
I have been looking at ways to do this for a while. My main VI saves the raw data to a text file which the users then import to Excel and plot. I am trying to simplify this process and have been looking at ways to accomplish this task. I want to be able to save the raw data to a file and then save the Labview graph as well. This will eliminate the tedious task of importing the raw data into Excel and plotting it. I can save the raw data to its own file and I can use the Get Image method for the graph and save it to its own file. I am currently using the .png format. Is there a way of saving both to the same file ie, importing the image into Excel or Word etc. Before I go off doing a science project I wanted to see if anyone else had experience completing this task and had any recommendations. Thanks in advance for any help.
well ther are a couple of ways. You could use the standard report generation VI's and make a complete report with the image of the graph embedded into the report with the raw data or you could use activeX and control excel thru LV and put the raw data into excel directly and have excel graph the data without any user interaction. I have posted a slew of VI's on the excel board if you do not have the report generation toolkit. If you could tell me which way you want to go I could possibly send you an example.
For more information and some sample VI's and tool kits, you can go to the excel board
Joe.
"NOTHING IS EVER EASY"
Maybe you are looking for
-
Hi technical support Team of Apple I am sorry but this time I am very disappointed with IPhone and IOS 7.1, actually I have IPhone 5,5S both and I was trying to Restore my Phone for sell Because I want to by IPhone 64 Gold but unfortunately bo
-
How to get rid of these reappearing invisible e-mail drafts?
I have a pretty crappy problem with my iPhone. Basically, if I begin to type an e-mail message (doesn't matter what e-mail account I use) and stop typing it (where it makes a draft), if I cancel/delete that draft and never send the e-mail, the draft
-
"Media Sync" and "Home Media" on the Nseries - how...
I've set up Home Media on the N79, and right now, if I try to browse to it from Windows, I get nothing. As far as Windows is concerned, there's no files being shared from it, I guess. It just loads up WMP and shows me my local library. Now, there's a
-
How do I convert my iphone videos (.mov) to .flv files?
How do I convert my iphone video (.mov) to .flv files?
-
I'm using Prores footage with metadata Timecode inserted into the Quicktime file. Then I edit the Quicktime file, click "Save" and then import the trimmed file into APP CS4. CS4 recognizes the edited clip and displays the timecode correctly (adhear