File txt to ASCII binary (MATLAB equivalent?)
Hello
I just started using LabView two days ago and need help with which is probably very basic. My goal is to take a .txt file that contains some message (letters, numbers, etc.) and convert it to a stream series of bits. In MATLAB, I would do it like:
Temp = textread ('CommsInput.txt', '%1s', 'spaces', "); % load the txt file.
text = char (temp); % Convert character cells
y = zeros (length (text) * 8, 1); % initialization vector o/p
for n = 1:1:length (text)
a = ABS (Text (n)); % find the number corresponding to each character ASCII
I = 8 *(n-1) + 1; % define indexing for output vector
y(i:i+7,1) = (de2bi (a, 8))'; % convert this number to a binary number of 8 bits (ANSII)
end
In the end, it would give me a (8 * N x 1) vector where N is the number of characters in the text file.
From there, I would be able to easily access every bit to create a signal Pulse Position Modulation, I want to use for the laser communication.
If anyone has any advice on how to implement this in LabView 8.2, it would be greatly appreciated!
Thank you
The file extension is not relevant. Each file is ultimately binary. Even text files. If I understand the objective, I believe that one of these two approaches will you need:
It is a text file that contained the text "ABCDEF".
Tags: NI Software
Similar Questions
-
Our clients have trouble downloading a text file (.txt) on our site version 33.0 (using a filestream). It worked well in previous versions.
The error message they get reads as follows:
{name of file and download user path} not can be saved, because the source file could not be read.Thank you
MikeIt is an old relative to corrupted downloads (http://kb.mozillazine.org/Source_file_could_not_be_read) error message, but has become more widespread in Firefox 33.
To make a long story short... before, if the server sent a response which was smaller than the specified size, the gap has been ignored and the download was considered to be very good. From Firefox 33, a file that is smaller than the specified size is considered as being damaged.
This comment in the bug tracking system has more information: https://bugzilla.mozilla.org/show_bug.cgi?id=1083090#c8
-
automatically load the different files.txt
Hello
I have an app that loads a file.txt previously created by a user... When the user lanuch of VI application ask the path of the file to load!
This user can create various files that configure the various points for his test...
What I want to do is launch the app and be able to load different files without having to ask the way once again automatically!
For example, the user create 4 files (point1.txt, point2.txt, point3.txt & point4.txt) my application could support only a single file, but I want to make a loop which allow the user to define the test sequence: point1.txt for 1 minute then point3.txt 2 minutes... etc...
Thanks for your help
-
Hi all
How to open or at least display a file that is not an Image, video, mempad, ringtone, voice note etc.
I just want to open a file txt (programmatically), I created in the emulator of the blackberry 8330.
Is there anyway to find this file?
The full path is file:///SDCard/MyFolder/the_bloody_file.txt //excuse language
but there is no way of me seeing/viewing it
Why is this? How can I solve this?
Thank you very much
Dan
In the Simulator--> open the Aplication of media. You can find the explore menu option. Click on it and go to ther SD card, you can find your file.
-
encrypt a file .txt in pl/sql
Hi all
I want to encrypt a .txt file and will result in an encrypted text file using oracle pl/sql 10g.
After that, I want to decrypt this encrypted file .txt.
How to do this? then it is possible?
Database 10g release 2 version
Remember to use UTL_FILE and DBMS_CRYPTO
http://docs.Oracle.com/CD/E11882_01/AppDev.112/e40758/d_crypto.htm#i1005082
-
Hi guys,.
I am facing a problem that you are trying to read a .txt using ODI (11.1.1.7).
My architecture has 3 servers. First with ODI installed with FDMEE agent, second with Essbase server and third Oracle database
I have an interface that loads of .txt file which is on another machine (Essbase). When I run the package that contains the interface using the local agent, it runs successfully, but when I run it using my FDMEE agent it omits this file could not be found.
I use a network path to load the file (such as \\ADDRESS_ESSBASE_MACHINE\... \File.txt).
What can happen so he can run correctly with the agent local and failure with the FDMEE agent?
Thank you
Kind regards.
Hello
If you read files from another machine, autonomous agent configuration is recommended.
If the FDMEE agent is not configured on the computer where the file exists, it cannot read the file.
you have other ways to do this activity, using ftp or sftp if you have network configurations in place.
hope that answers your question
Kind regards
Vinay
-
How to get textFrame contained in the file ".txt"?
Hi all
I want to write my text frame content in a ".txt" file Right now, I have my content of PMString text frame.
And I use regular C++ file manipulation.
To write to the file, I used it-> "std::string string_name = PMString_name. GetPlatformString(); "
But it returns me a single line string and writes it to the file...
for example.
If PMString is->
"ABCD".
EFGHIJK
LMN.
then give me platformstring->
"ABCDEFGHIJKLMN".
But I need an exact replica of the content of my text frame in my file ".txt", with all line breaks and empty spaces.
Can anyone please suggest me something?
PMString::GetPlatformString() works very well.
See your text by MS Word or Wordpad.
-
Extract strings in the tdms files and write the strings in the file txt or lvm
Hi all
I'm struggling to extract strings from a file of tdms to write them in a txt file.
The strings were written in tdms is a time stamp data recorded to a compact RIO.
I put the chain in a different group from the PDM, but when I use the function read tdms with the group name, as I said, an error message is always take place.
Thanks for all the help.
PS: I have attached an example of tdms file I got over here.
Kind regards
Yifeng
I tried your attached file and it seems that everything goes file. I have attached the screenshot of my VI here, what do you want?
-
file txt and questions about conspiring field
Hello everyone, I'm trying to plot a graph xy of a txt file and I am having some problems. I enclose the program and and the txt file, I'm getting, don't forget it's prety base, can someone tell me what is the problem? Also more information on trace would be useful as well, for example I can plot from a machine in time real (I enclose also a file to use for communication with the machine) also is there a way to delete a line that is not in the top of the file? Thanks in advance
Reading data from the field
1. your file uses two spaces as the delimited. Change that to be a tab.
2. you need to index on COLUM, not the line.
DAS
1 write the file inside the loop. Be sure to open/create the file before the loop and close the file after the loop. This will allow you to eliminate the shift register and you save a lot of memory.
2. If you want to plot the data, I recommend using a graph. In this way, you have just to the wire in the last value once you converted to digital.
-
Save to spreadsheet files *.txt
Hello.
I have a program that creates a 2D, measures table.
Then, I want to give the user an option to save to a file.
So I chose the VG function "write on the worksheet file.vi"(peut-être que vous pouvez suggérer de faire autrement). "."
Then, when it runs the dialog box opens to ask where to save the file. Empty file name, and the file type is "all files". What I want is to set the default *.txt file type, if the user do not care about this.
How can I do?
Thank you
The function of file dialog box has an entry called "model (all files). Set this value *.txt.
-
Excel file is not recognized by Matlab
Hello
I'm saving my data (with headers) using the function 'Write to a spreadsheet file' in file .xls. Windows will recognize such as Excel and it opened ok. But when I'm reading in Matlab by function "xlsread", I get an error "not in the Microsoft Excel Format".
Where I'm wrong?
(I have attached my code: it's the creative header Subvi; digital data is added in additional Subvi by using the function 'Write to a spreadsheet file' even)Hello Dvorkind,
I thank very you much for your message on our forum. There is a difference between a file delimited by tabs and an excel file, and I think that it is the source of the problem, that we are facing here. Please consult the following KB .
Here, they speak the tool report generation (you can try assessment to see if this solution will solve the problem). Alternatively, you can try to Excel by using the possibilities of activeX in Labview.
I hope this will help you in addition,
Best regards
-
I have a problem I can't solve, and I'm sure it's a simple enough solution.
I want to edit text in a game program files, but when I try to do this and save the modified file, I get an error Notepad:
Cannot create the C:\ProgramFiles\Sony\Everquest\maps\discord_2.txt file.
So, I then try to work around that by recording as a file C:\ProgramFiles\Sony\Everquest\maps\discord_3.txt but then I get an error message "save under" as follows:
C:\ProgramFiles\Sony\Everquest\maps\discord_3.txt that you do not have permission to save in this location. Contact the administrator for approval. You want to save in the documents folder instead?
Well, saving them in the Documents folder would do me any good because then the program wouldn't read my additional text.
I've never had a problem when downloading of the txt files on websites like Mapfiend.com that then replace the text file, so why I cannot simply edit a text file?I thought I was the administrator of my PC, but clearly not. So I rebooted and hit F8 tried staring at me as administrator but was unable to do. I just got my login: "Martin" as the only choice, no option to change the administrator user. What I've done wrong? Or better yet, what should I do to recover as an administrator?
I hope hear from you soon. Thank you.Hi Mlewk,
Thanks for posting on the forum of answers.microsoft.com communities.
It is interesting that you have to edit the documents as suggested. When referring to the configuration yourself as an administrator, here is a link that will show you how to create or add user rights.
http://windowshelp.Microsoft.com/Windows/en-us/help/7dcf289b-5fd3-41FD-A290-936f274def771033.mspx
See also change account type
http://windowshelp.Microsoft.com/Windows/en-us/help/74603287-0ee9-4470-9a4e-3d791f95f4c61033.mspx
This is the definition that your account is actually an administrator.
Another suggestion must also run Notepad as administrator before opening the application and import the text file to make the changes.
Here's how; 1. click on start ORB / in line search type Notepad / in a list of programs - RIGHT CLICK on Notepad and select RUN AS ADMINISTRATOR
Import your text file, you change, make the changes and then save the location you had suggested.
Let us know how it works for you or if you need further assistance.
Kind regards
Debbie Microsoft Support Engineer answers visit our Forum of Microsoft answers Feedback and let us know what you think.
-
Convert file .ctt file .txt
How to convert my contact list of the .txt file .ctt file
Hello
In most cases will not convert simple txt file in XML format
Otherwise, it depends on the layout of the contents of your text file.
Read this page for more precision.
http://www.stylusstudio.com/text_file_to_xml.html
Jack MVP-networking. EZLAN.NET
-
create or replace procedure Dynamic_Table AS
iVal VARCHAR2 (32);
iTemp varchar (200): = ";
sql_stmt VARCHAR2 (200);
l_file1 UTL_FILE. TYPE_DE_FICHIER;
l_file utl_file.file_type;
BEGIN
l_file1: = UTL_FILE. FOPEN ('TEST', 'dinput.txt', 'R');
EXECUTE IMMEDIATE ' CREATE TABLE baseline (Item_ID varchar2 (32))';
Loop
BEGIN
UTL_FILE. GET_LINE (l_file1, iVal);
EXECUTE IMMEDIATE ' insert into baseline values (: ival) "using ival;
EXCEPTION
WHEN No_Data_Found THEN EXIT;
While some OTHER THEN dbms_output.put_line (SQLERRM); * /
END;
end loop;
END;
You are approaching this the wrong way. Create an external table based on the file. External tables are CSV, fixed width data in a queryable table.
You will need to create an oracle directory to put the file in (MY_ORA_DIR) I leave it for you to do, and then perform the following...
create table BASELINE)
ITEM_ID varchar2 (32)
)
EXTERNAL ORGANIZATION
(
TYPE ORACLE_LOADER
THE DEFAULT DIRECTORY MY_ORA_DIR
ACCESS SETTINGS
(
RECORDS DELIMITED BY NEWLINE
LOGFILE "dinput.log".
BADFILE "dinput.bad."
NODISCARDFILE
FIELDS
(
ITEM_ID
)
)
LOCATION ("dinput.txt")
)
REJECT LIMIT UNLIMITED
/
All the dubious records appear in dinput.bad. Dinput.log will give you information.
External tables are read-only, so once you set up your file, you can create editable as a normal table.
create table ITABLE_EDITABLE as
Select * from BASELINE
/
Work done, a few lines of code.
-
Hi guys,.
IAM trying to find a plsql/pkg process that creates a file for example myiphones.txt (with content) and save this file as BLOB directly in a table in the DB (not on file system moreove there is no access to the file system) - Ive studied this but nothing about other than as_pdf3 that iam still working on.
Here are the summarized steps:
-------------------------------------------
1. run plsql to create a single file like myiphone.txt,
2. in this (myiphone.txt) inserts a record content from another table EMP as,
MYiPhone.txt
============
Greg Taylor,
Mike Owen
3 then finally record this (myiphone.txt) in another table MYFILES as BLOB - Note Please that I don't want to not refer to file system manager and I have not access to it for the time being,
I hope it is clear
no idea about the way to handle this is appreciated?
Thank you.
You can try this:
Data are from a clob table.
DECLARE L_BLOB BLOB; L_CLOB CLOB; L_DEST_OFFSET INTEGER := 1; L_SRC_OFFSET INTEGER := 1; L_LANG_CONTEXT INTEGER := DBMS_LOB.DEFAULT_LANG_CTX; L_WARNING INTEGER; L_LENGTH INTEGER; BEGIN -- create new temporary BLOB DBMS_LOB.CREATETEMPORARY(L_BLOB, FALSE); --Select CLOB SELECT CLOB_VAL INTO L_CLOB FROM MY_TABLE; -- tranform the input CLOB into a BLOB of the desired charset DBMS_LOB.CONVERTTOBLOB( DEST_LOB => L_BLOB, SRC_CLOB => L_CLOB, AMOUNT => DBMS_LOB.LOBMAXSIZE, DEST_OFFSET => L_DEST_OFFSET, SRC_OFFSET => L_SRC_OFFSET, BLOB_CSID => NLS_CHARSET_ID('WE8MSWIN1252'), LANG_CONTEXT => L_LANG_CONTEXT, WARNING => L_WARNING ); -- determine length for header L_LENGTH := DBMS_LOB.GETLENGTH(L_BLOB); -- Your custom INSERT INTO statement INSERT INTO MY_TABLE (NAME, BLOB_FILE, BLOB_LENGTH ) VALUES ('lala.txt', L_BLOB, L_LENGTH ); EXCEPTION WHEN OTHERS THEN DBMS_LOB.FREETEMPORARY(L_BLOB); RAISE; END;
Concerning
Tobias
Maybe you are looking for
-
communication of 64-bit application with 32-bit application on a PC?
In a project of image processing, we started using x 64 LabVIEW to meet our need expanded memory. However, in order to communicate with the production plant is integrated in the machine, we wanted to use a Profibus DP - COMSOFT PCI card, which is a n
-
This is the error I get when I try to play a WMV file like a song: "Windows Media Player cannot play the file because there is a problem with the audio device. "It might not be a sound device installed on your computer, it can be used by another prog
-
Invoke.APP_TYPE_MESSAGES problem?
Hi all We have Invoke.APP_TYPE_MESSAGES in our application as follows: Invoke.invokeApplication (Invoke.APP_TYPE_MESSAGES, new MessageArguments (MessageArguments.ARG_NEW,[email protected], "","")); what application calls this the screen open code, The
-
Smartphones blackBerry Device Manager update failed
Hello I use a BOLD 9900. lately, BB DEVICE MGR has not detected the 'disconnected' phone, so I installed an update reported by MGR of DEVICE. the updated bundle 2108 v7.1 2807 bundle v7.1 update. during the sequence of steps displayed on the screen
-
HI - where can I find the hard drive for a ProBook 6460 b device driver? I need to re - install Win 7 (64-bit) and windows install tells me '... This computer's hardware may not support booting to this disk. Make sure that the drive controller is ena