Ignoring characters in a file while parsing
Posted
by sfactor
on Stack Overflow
See other posts from Stack Overflow
or by sfactor
Published on 2010-04-19T15:05:43Z
Indexed on
2010/04/19
16:13 UTC
Read the original article
Hit count: 208
i need to parse through a text file and process the data. the valid data is usually denoted by either a timestamp with TS followed by 10 numbers (TS1040501134) or values with a alpabet followed by nine numbers (A098098098)...so it will be like TS1040501134A111111111B222222222...........TS1020304050A000000000........
However, there are cases when there will be filler 0s when there is no data. So, such a case might be
00000000000000000000TS1040501134A111111111B2222222220000000000TS1020304050A000000000........`
Now as we can see I need to ignore these zeros. how might i do this? I am using gnu C.
© Stack Overflow or respective owner