Read from a file list
Hi everyone,
This is the first question in this forum. I'm writing a program that capture and save several signals in different files. The files are named automatically. Now, I want make a front panel that lists all the saved files and when the user selects a specific file, the data on that file will be displayed. Can anyone give me some hints to do that.
Thanks
Mike
see if the attached vi helps you
Attachments:
select file.vi 21 KB
Similar Messages
-
while updating the older version iTunes to latest one it shows "a network error occurred while attempting to read from the file: C:\windows\installer\iTunes64.msi. pls help on this matter to connect my i5 to PC. Thanks in advance
(1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
http://majorgeeks.com/download.php?det=4459
(2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
(3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
(4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
(5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time? -
When I try to install Itunes, I get this error: (translated from Norwegian) There was a network error while trying to read from the file: C: \ windows \ installer \ iTunes.msi I have tried many times to reinstall, but nothing helps, please help me.
(1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
http://majorgeeks.com/download.php?det=4459
(2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
(3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
(4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
(5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time? -
iTunes has tried to update itself and runs into an error and tells me to manually install. When I d/l and run the iTunesSetup.exe file I always encounter the following error message...
"A network error occured while attempting to read from the file C;|Windows|Installer|iTunes.msi" and iTunes does not update to iTunes 10.4.1.
Anyone know what is creating this error message? Thanks for the help...(1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
http://majorgeeks.com/download.php?det=4459
(2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
(3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
(4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
(5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time? -
How do i do the replacement by reading from a file ?
The multibyte representation in cloumn 2 in the input file is encoded in UTf8 format.
I have the code to get the code point value from a multibyte representation.
But i am not sure how to do the same when reading from a file.
A better explanation of the requirement is like this,
I have a java program ,i have a String="test";
I traverse the string
on encountering the character 't' i read from the input file ,the input file has the characters m to z listed in it, and it also has the UTF8 encoded multibyte representation in it.
I then read from the file
I search the file to get he character 't'
on gettin the character 't' i get the corresponding multibyte representation from the input file
Then i get the unicode code point value for the multibyte representation that i got from the input file.
Lastly i replace the character 't' in the string with the unicode code point value 3046
Hope the requirement is clear
Please do help
Any help would be very useful
Thanking you
khurramI am still not sure as to what your problem is. It would be better if you specify as to where the problem lies in the steps that you have stated and ask for a solution.
agar yeh homework hai to log yehan par isse appreciate nahin karte. Acha hota agar requirements ki bajai problem discuss ki jati. -
Read From Spreadsheet File help
I am saving all my data to a text file (See attached file). The problem is that when I try and use the Read From Spreadsheet File.vi I am unclear on how to make it show all my data.
Does anyone know a away for me to read the whole file and display it all at once reather than line by line?
Solved!
Go to Solution.
Attachments:
test data 1.txt 6 KBThe read from spread sheet Vi has two data outputs : the top right retrieves the whole file as a 2D array, if you leave the "number of rows" input on the left unwired.
Message Edité par chilly charly le 01-07-2009 11:22 AM
Chilly Charly (aka CC)
E-List Master - Kudos glutton - Press the yellow button on the left... -
Read from one file ... and write
I had written below code to read from a file
which has input in below format...
$ filla
% dillla
I wrote a code to read from the below file and I want to write into another file...
in another format...like
filla, $
dilla, %
I wrote as below... but my code doesn't work....i commented most of the code becoz I doubt ....
I read the file...line by line...
each line has two words one is special characters($ or %) and the other is some name... separated by space..
I stored both in different arrays...and thought to write them in output file...
import java.io.*;
public class data
public static void main(String args[])
int kMaxLines = 60000;
String[][] valuePairs = new String[2][kMaxLines];
String symbol [] = new String[kMaxLines];
String name [] = new String[kMaxLines];
int k = 0;
try
FileInputStream fstream = new FileInputStream("c:/inputs.txt");
DataInputStream datastream = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(datastream));
//FileWriter output = new FileWriter("c:/output.txt");
//BufferedWriter bw = new BufferedWriter(output);
String names;
String strLine;
int line = 0;
while ((strLine = br.readLine()) != null)
String temp_strs[] = strLine.split(" ");
for (int j = 0; j < 2; j++)
valuePairs[j][line] = temp_strs[j];
//System.out.println(temp_strs[0] + " " + temp_strs[1]);
symbol[k]= temp_strs[0];
name[k]=temp_strs[1];
line++;
k++;
for (k=0; k < kMaxLines; k ++)
System.out.println(symbol[k]+ "" + name[k]); // when I print it is giving null value...
} // so what I do to get those values into global array...
datastream.close();
// to write to file
//String names_str;
//bw.write("@relation train");
//for(k=0; k<kMaxLines; k++)
// names_str = names+""+name[k];
//bw.write("@attribute names" + " {"+names_str+"}");
//bw.write("@attribute class {+,-}");
//bw.write("@data"+"\n");
// for (k=0;k<kMaxLines; k++)
//bw.write("name[k]+","+symbol[k]");
catch (Exception e)
//file not found exception...
e.printStackTrace();
Why the multiple arrays?
I'd just read it into List<String[]>... an extensible collection of "the fields on each line"... then you just write them out as required.
second-field + comma + first-field.
I suggest your next move should be to take a backup copy of your current class then rip-all that commented-out code out of it, and reformat it properly... starting from a clean(er) slate... then try swapping over to a List<String[]> instead of that cumbersome String[][] matrix.
Try that... if you get stuckeroonied then don't be afraid to ask again.
Cheers. Keith. -
Problem with reading from DAT file. FileNotFound exception
Can't seem to find the issue here. Two files, one (listOfHockeyPlayers) reads from a DAT file a list of players. The other (HockeyPlayer) has just the constructor to make a new hockey player from the read data.
import javax.swing.*;
import javax.swing.event.*;
import java.util.*;
import java.awt.*;
import java.io.*;
public class ImportHockeyPlayers
private ArrayList<HockeyPlayer> listOfHockeyPlayers = new ArrayList<HockeyPlayer>();
public ImportHockeyPlayers(String fileName)
throws FileNotFoundException
try
Scanner scan = new Scanner(new File(fileName));
while (scan.hasNext())
//Uses all the parameters from the HockeyPlayer constructor
String firstName = scan.next();
String lastName = scan.next();
int num = scan.nextInt();
String country = scan.next();
int dob = scan.nextInt();
String hand = scan.next();
int playerGoals = scan.nextInt();
int playerAssists = scan.nextInt();
int playerPoints = playerGoals + playerAssists;
//listOfHockeyPlayers.add(new HockeyPlayer(scan.next(),scan.next(),scan.nextInt(),scan.next(),scan.nextInt(),scan.next(),
//scan.nextInt(),scan.nextInt(),scan.nextInt()));
catch(FileNotFoundException e)
throw new FileNotFoundException("File Not Found!");
public String toString()
String s = "";
for(int i = 0; i < listOfHockeyPlayers.size(); i++)
s += listOfHockeyPlayers.get(i);
return s;
public class HockeyPlayer
private String playerFirstName;
private String playerLastName;
private int playerNum;
private String playerCountry;
private int playerDOB;
private String playerHanded;
private int playerGoals;
private int playerAssists;
private int playerPoints;
public HockeyPlayer(String firstName, String lastName, int num, String country, int DOB,
String hand, int goals, int assists, int points)
this.playerFirstName = firstName;
this.playerLastName = lastName;
this.playerNum = num;
this.playerCountry = country;
this.playerDOB = DOB;
this.playerHanded = hand;
this.playerGoals = goals;
this.playerAssists = assists;
this.playerPoints = goals + assists;
DAT File
Wayne Gretzky 99 CAN 8/13/87 R 120 222
Joe Sakic 19 CAN 9/30/77 L 123 210These are all in early development, we seem to have the idea down but keep getting the odd FileNotFound exception when making an object of the ImportHockeyPlayers class with the parameter of the DAT file.
We might even be on the wrong track with an easier way to do this. To give you an idea of what we want to do...read from the file and be able to pretty much plug in al lthe players into a GUI with a list of the all the players.
Thanks for your time.Thanks for the tip on the date format...good to
know.
public static void main(String[] args)
GUI gui = new GUI();
ImportHockeyPlayers ihp = new
ImportHockeyPlayers("HockeyPlayers.dat");
}It's just being called in the main.
Throws this error:
GUI.java:39: unreported exception
java.io.FileNotFoundException; must be caught or
declared to be thrown
ImportHockeyPlayers ihp = new
ImportHockeyPlayers("HockeyPlayers.dat");
^This error is simply telling you that an exception may occur so you must enclose it in a try catch block or change the main method to throw the exception as follows
public static void main(String[] args) throws
java.io.FileNotFoundException {
GUI gui = new GUI();
ImportHockeyPlayers ihp = new
ImportHockeyPlayers("HockeyPlayers.dat");
}or
public static void main(String[] args) {
GUI gui = new GUI();
try {
ImportHockeyPlayers ihp = new
ImportHockeyPlayers("HockeyPlayers.dat");
catch (FileNotFoundException e) {
System.out.println("error, file not found");
}I would reccomend the second approch, it will be more helpful in debugging, also make sure that the capitalization of "HockeyPlayers.dat" is correct
hope that helps -
UPDATE 2: Phoned Toshiba tech support again, guided by techie to begin the recovery again. Just before phoning I was able to go into recovery options and view the drive setup and all the files that couldn't be read are on the CD so I've no idea why the error kept occuring, and neither did the techie. Fingers crossed it works this time but I'm not overly hopefully given that we've just done exactly the same as I did before. UPDATE 1: I got into the BIOS and reset everything back to defaults and yay, my toshiba recovery wizard now starts! :-D On the down side, when trying to do a factory default software / out of the box recovery I continually get error messages with regards to copying the files, for example
cannot read from source file or disk
7z.dll
Type application extension
size 585kb
date modified 7/14/2009 10.26pm
other read / copy errors include PREINST6.SWM, BOOT_32, BOOTPRIORITY, CHECKMAXPTSIZE, CHGBOOT, CPU, CPUCHECK, CREATEPARTITION, CTRLDRVINFO, DISKWIPE, DMI, DPINST32, EBLIB.DLL, ERRORDIALOG, EW3BOOTSEQ, FWLINK, FWLINK.SYS, GETHDDINFO, GETKEYSTATE, IMAGEX, INFILED, INITRECAREA, KRAIADAPI.DLL ..... at which point I decided to 'skip all' :-/
Any explanations as to what's going on and how I might be able to fix it would be very much appreciated! :-) Thank you!
I have a two and half year old satellite L500 with an Intel i-3 and 4 gigs of RAM, on which I was running Windows 7.
Admittedly it’s had rather a hard life (I ran some very demanding CAD / graphics software on it) but it had always performed well until just recently, when after suffering several BSOD (which had never happened before), the hard drive failed.
I partitioned and formatted a brand new hard drive (which is perfectly fine and functions normally when hooked up to another laptop with a SATA to USB cable) and obtained system recovery discs from Toshiba. Unfortunately, when I try and run the first disc, windows starts to load files but then generates an error screen with the message Error F3-F100-0003 and a request to turn the computer off.
When I use the windows Memory Diagnostic to get into the Windows Boot Manager Screen I get the following;
Windows failed to start. A recent hardware / software change might be the case.
To fix the problem
Insert your windows installation disc and restart your computer
Choose your language settings and click ‘next’
Click ‘repair your computer’
File: \boot\memtest.exe
Status: 0xc000000f
Info: the selected entry could not be loaded because the application is missing or corrupt.
I can also use F8 on startup to get into the advanced boot options but selecting any of them simply results in the F3-F100-0003 error message. I’ve run a memory test using the UBCD, which tells me the memory is fine, and tried another hard drive (which also works perfectly well in another laptop) but no joy. On phoning Toshiba support the techie said my hard drive had failed, but as I say, both hard drives are perfectly fine / usable when hooked up to another laptop. I’m now completely stuck as to what the problem is and how I might resolve it – any advice / suggestions would be most gratefully received! Thank you in advance :-)Satellite L655-S5096
Downloads here.
the second disc gives me the the "cannot read from source file or disk PREINST8.SWM"
My best guess is that the disc is not readable. Try copying it to another. Sometimes that works.
Otherwise, order new discs from Toshiba.
-Jerry -
ITUNES WILL NOT DELETE FROM ADD @ REMOVE PROGRAMS,
MESSAGE, READS a network error occured while attempting to read from the file C:WINDOWS\installer\iTunes.msiAll sorted now just needed to repair itunes from control panel
-
Why does Read from Text file default to array of 9 elements
I am writing to a text file starting with a type def. cluster (control) of say 15 dbl numeric elements, that works fine I open the tab-delimited text file and all of the elements appear in the file. However when I read from the same text file back to the same type def. cluster (indicator), the read from text file defaults to 9 elements?? Is there a way to control how many elements are read from the file. This all works great when I initially use a cluster of 9 elements and read back to a cluster of 9 elements.
Solved!
Go to Solution.From the LabVIEW Help: http://zone.ni.com/reference/en-XX/help/371361G-01/glang/array_to_cluster/
Converts a 1D array to a cluster of elements of the same type as the array elements. Right-click the function and select Cluster Size from the shortcut menu to set the number of elements in the cluster.
The default is nine. The maximum cluster size for this function is 256.
Aside: so, how many times has this question been asked over the years? -
How to open saved files using 'read from text file' function
Hi everyone, I am having a hard time trying to solve the this particular problem ( probably because I am a newb to lanbview ). Anyway , I am able to save the acquired waveforms by using the 'Write to text file' icon. I did manually modify the block diagram of the 'Write to text file' icon and create the correct number of connector so as to make my program work. But now I have no idea on how to modify the block diagram of the 'Read from text file' block diagram to make my program 'open' my saved waveforms. Or i do not have to modify anything from the block diagram of the 'Read from text file'? Can anyone teach/help me connect up? Do i need the build array on the "open" page?
Here are some screenshots on part of my program
let me know if you guys would need more information / screenshots thank you!
Attachments:
ss_save.jpg 94 KB
ss_open.jpg 94 KB
modified_writetotextfile.jpg 99 KBOhmy, thanks altenbach. oh yeah i forgot about those sub VIs. will upload them now. Was rather demoralized after reading the comments and really struck me on how weak i'm at on labview really hope to get this done. But of course i have to study through and see how it works. Actually i am going to replace those 'signal generators sub vi' with ThoughtTechonology's sample code so i can obtain data waveforms real-time using Electrocardiography (ECG) ,Electromyography (EMG ) and Electroencephalography (EEG) hopefully i can find out how to connect the sample code.
( ps . cant connect it now unless my program is working otherwise labview will crash )
( p.s.s the encoder of my biofeedback trainer already acts as an DAQ so i wont need to place an DAQ assistant in my block diagram i suppose )
The sample code of ThoughtTechnology is named as attachment.ashx.vi. too bad i cant use it and present it as my project
Attachments:
frequency detactor.vi 53 KB
signal generator.vi 13 KB
attachment.ashx.vi 40 KB -
LabVIEW for ARM 2009 Read from text file bug
Hello,
If you use the read from text file vi for reading text files from a sdcard there is a bug when you select the option "read lines"
you cannot select how many lines you want to read, it always reads the whole file, which cause a memory fault if you read big files!
I fixed this in the code (but the software doesn't recognize a EOF anymore..) in CCGByteStreamFileSupport.c
at row 709 the memory is allocated but it tries to allocate to much (since u only want to read lines).
looking at the codes it looks like it supposed to allocated 256 for a string:
Boolean bReadEntireLine = (linemode && (cnt == 0));
if(bReadEntireLine && !cnt) {
cnt = BUFINCR; //BUFINCR=256
but cnt is never false since if you select read lines this is the size of the file!
the variable linemode is also the size of the file.. STRANGE!
my solution:
Boolean bReadEntireLine = (linemode && (cnt > 0)); // ==
if(bReadEntireLine) { //if(bReadEntireLine && !cnt) {
cnt = BUFINCR;
and now the read line option does work, and reads one line until he sees CR or LF or if the count of 256 is done.
maybe the code is good but the data link of the vi's to the variables may be not, (cnt and linemode are the size of the file!)
count should be the number of lines, like chars in char mode.
linemode should be 0 or 1.
Hope someone can fix this in the new version!
greets,
Wouter
Wouter.
"LabVIEW for ARM guru and bug destroyer"I have another solution, the EOF works with this one.
the cnt is the bytes that are not read yet, so the first time it tries to read (and allocate 4 MB).
you only want to say that if it's in line mode and cnt > 256 (BUFINCR) cnt = BUFINCR
the next time cnt is the value of the bytes that are not read yet, so the old value minus the line (until CR LF) or if cnt (256) is reached.
with this solution the program does not try to allocate the whole file but for the max of 256.
in CCGByteStreamFileSupprt.c row 705
if(linemode && (cnt>BUFINCR)){
cnt = BUFINCR;
don't use the count input when using the vi in line mode. count does not make sense, cnt will be the total file size. also the output will be an array.
linemode seems to be the value of the file size but I checked this and it is just 0 or 1, so this is good
update: damn it doesn't work!
Wouter.
"LabVIEW for ARM guru and bug destroyer" -
Trying to parse a file-read from text file.vi
I'm attempting to read a txt file that has tab separated data. In the fourth (or any) column is the only data I need. The data is a string of numbers (23.454).
I've used the Read from Text File.vi and the Read From Spreadsheet.vi and I just don't seem to have enough LV background to extract the pertinent data into a graph. any suggestions?(It is silly to use "delete from array" if all you want is a column. The correct function is "index array")
Joe's idea above basically works fine. Here's a quick adapdation (the node before the graph is "index array" from the array palette.).
Message Edited by altenbach on 06-11-2007 11:57 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
FileRead.png 11 KB -
Set a timeout for "read from text file"
I Need to read from a text file on a remote pc and use the read from text file function to do this. It wotks but sometimes this pc is down causing long wait times in my vi.
Is there a way to set a timeout for the read from text file function, or is there an other solution?
Thank youYou could check that the path is valid first before you attempt to read the file. hen put the file read in a True-False case structure based on the results of the check. You can use the function "Check if File or Folder Exists" It checks whether a file or folder exists on disk at a specified path. This VI works with standard files and folders as well as files in LLB files. The function is found in the File I/O --> Advanced File Functions palette.
Tom
Maybe you are looking for
-
Backing up and restoring iPhoto Library
I am currently using Time Machine to back up my iMac, including my iPhoto Library, which is quite large (80 GB). If I have to restore the iPhoto Library, will the photos retain their descriptions so that I an reorganize them? How about using a cloud
-
Can you use home sharing over multiple itunes accounts which all use the same wifi?
The question says it all
-
PDF Maker in Excel 2003 prompts to save multiple files for one report
It seems each time i try to PDF multiple tabs I end up having to save more than one copy of the report in order to get all the sheets in PDF form. I then have to merge all the PDF copies into one file and save it. Does anyone know why it is generat
-
Hello, We are using WD ABAP as an input form in our GP process. Currently, WD ABAP contains input parameters but doesn't have the same output parameter functionality that WD Java does. From reading other threads on SDN and logging an OSS message, S
-
Network Manager fails to detect unsecured network.
My current laptop uses a clean install of Arch Linux with the latest gnome-shell release. NetworkManager has no problem connecting to the wireless networks at home, but the problem I have is at college. My college has an open wireless network; someti