Algorithm load data from a text file into an array - how to do ?

Anything not related to STM32
Post Reply
acronis
Posts: 143
Joined: Thu Mar 02, 2017 12:32 pm

Algorithm load data from a text file into an array - how to do ?

Post by acronis » Fri Aug 04, 2017 5:00 am

I need to load in the 'tags' data from a text file from SD CARD. The number of rows may be different.In the attachment sample file. Tell me how quickly and correctly to do it.
I need to download RFID cards


int tags[][14] = {
{2, 48, 66, 48, 48, 54, 50, 48, 54, 66, 70, 68, 48, 3},
{0, 2, 55, 53, 48, 48, 56, 49, 68, 65, 55, 0, 0 },
{0, 2, 49, 54, 48, 48, 49, 69, 55, 50, 56, 0, 0 }
{2, 49, 54, 48, 48, 49, 69, 55, 50, 56, 55 }
// can be another line.
};


test.txt (the file is a simple text)

Code: Select all

4,48,66,48,48,54,50,48,54,66,70,68,48,22
5,2,55,53,48,48,56,49,68,65,55,0,7
7,2,49,54,48,48,49,69,55,50,56,0,4
13,49,54,48,48,49,69,55,50,56,34
55,49,54,48,48,49,69,55,50,56,99
2,49,54,48,48,49,69,55,50,56,65   

the other lines in the same format.

User avatar
Pito
Posts: 1627
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Algorithm load data from a text file into an array - how to do ?

Post by Pito » Fri Aug 04, 2017 10:50 am

Pukao Hats Cleaning Services Ltd.

Post Reply