Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

reading a file which contains text and number in matlab

Status
Not open for further replies.

hengam

Newbie level 4
Newbie level 4
Joined
Jul 25, 2013
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
37
Hi
I have a file which is like:

$DATA1 SOURCE='HSPICE' VERSION='D-2010.03 32-BIT'
.TITLE '* inverter'
index vdd vtp vtn
lgate power temper
alter#
1.0000 0.7500 -0.7100 0.3500
36.0000 -2.095e-16 0.
......
.....
which means it contains both number and text I just want the highlighted number and omit the others.
what can i do using matlab?
Thanks in advanced
 

Hi,

You can skip the text with fseek and then read the numbers. For instance:

f = fopen('filename.txt');
fseek(f, 122, 'bof');
A = fscanf(f,'%f',[2,4]);

Hope this will help
 
  • Like
Reactions: hengam

    hengam

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top