How to read files of different types?
Show older comments
https://drive.google.com/file/d/0B4opCeiIoNAMTE9rTW9adVNNV0E/view?usp=sharing The link contains codes and 3 files(1 is a txt file and 2 & 3 are log files). I intend to input file name without without the file extension. File 1 is processed by button 1 whiles file 2 and 3 are processed by button 23. When button 23 is pressed it gives the opportunity for button 2 and 3 to be displaced for the respective files to be opened and read. However, I am having errors.
What I wanted to do was that for each case read the corresponding file and save them in columns (columns 1 to 15). Making sure that only rows with $GPGGA are read and saved in the case 1 and case 2. Whiles $GNGGA are read and saved in the case 3. Also in the codes, I used the for loop to select either $GNGGA or $GPGGA and also remove empty cells
Case 1 will be used to processes 1.txt file, case 2 for 2.log and case 3 for*3.log*.
These 3 files would be processed one at a time and I want it to be read so that all columns of the file being processed are saved.
7 Comments
Walter Roberson
on 20 Jul 2015
You have not granted public permission to those files on Google Drive.
"I am having errors" is not very specific :(
Star Strider
on 20 Jul 2015
I can’t open the files in that link. (I don’t have ‘permission’ and I don’t particularly need it.)
None of us can help you unless we can see your code. Please describe in detail what you intend to do in your code, as well as posting it.
What do you want your code to do? What is it doing that you do not want it to do, or not doing that you want it to do?
AbelM Kusemererwa
on 20 Jul 2015
Edited: AbelM Kusemererwa
on 20 Jul 2015
Star Strider
on 20 Jul 2015
It would be easier if you uploaded your files using the ‘paperclip’ icon, then doing both ‘Choose file’ and ‘Attach file’, if the actual files and their contents are important for us to Answer your Question.
Please do the other items I requested, specifically describing in detail what you want your code to do, and what it is doing instead.
AbelM Kusemererwa
on 20 Jul 2015
Edited: AbelM Kusemererwa
on 20 Jul 2015
Stephen23
on 21 Jul 2015
Given that the "log" files are most likely text then you could have simply changed their file extension to .txt and uploaded them with the paperclip button.
AbelM Kusemererwa
on 24 Jul 2015
Accepted Answer
More Answers (0)
Categories
Find more on Characters and Strings in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!