[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Importing a .txt file as string or finding expressions in said text file
From: |
Benji_123 |
Subject: |
Importing a .txt file as string or finding expressions in said text file |
Date: |
Mon, 6 Apr 2020 17:16:07 -0500 (CDT) |
Hi guys, I hope I've managed to set up this mailing list thing properly...
Anyway, I'm trying to import data from a text file, the data consists of a
letter followed by numbers encased in a d=" " phrase (for example d="M2 3q2
3 2 1") - in this case I'd like to read M 2 3 and Q 2 3 2 1 - the catch is
the sequence of letters and numbers isn't set or constant, and what's even
worse the number of numbers following each letter isn't set (so I can have
'c 1 2 3 4 q 1 2' or 'c 1 2 3 4 5 6 7 8 q 1 2')
Any idea how to even begin with this thing? Either I'm missing something or
there isn't even a function that would allow me to read the file as a string
so I could later work with it using strfind (which I started toying with
now, don't know yet if that even is going to work), but maybe Im missing
something?
TL;DR - can I import text file as string and/or find a certain pattern in an
irregular text file?
Thanks for any suggestions, Benji
--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
- Importing a .txt file as string or finding expressions in said text file,
Benji_123 <=