exctract column from files

2 views (last 30 days)
ACICY
ACICY on 13 Dec 2019
Answered: Guillaume on 13 Dec 2019
Hello so from this file i need distract only this information wich is shown belown
5657.119 N 02404.880

Answers (2)

Guillaume
Guillaume on 13 Dec 2019
Simply use readtable which has no problem parsing the file:
locations = readtable('New Text Document.txt');
locations.Properties.VariableNames([3 5]) = {'Latitude', 'Longitude'}

Bhaskar R
Bhaskar R on 13 Dec 2019
Edited: Bhaskar R on 13 Dec 2019
data = importdata('New Text Document.txt');
x = cellfun(@(x)strsplit(x, ','), data, 'UniformOutput', false);
result = cell2mat(cellfun(@(in)strjoin(in([3:5])), x, 'UniformOutput', false));

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!