Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7535025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:11:05+00:00 2026-05-30T06:11:05+00:00

I’m developing a piece of embedded hardware that requires some data from a PC.

  • 0

I’m developing a piece of embedded hardware that requires some data from a PC. I’m using a FAT32 formatted SD Card to provide this information. The data is just an excel file that I export to CSV. My question is, should I let the uC (AT Mega 128L) handle this using char* strtok (char *s, const char *delim) or should I write a small utility that converts this CSV file to a binary format?

Performance, as long as it’s reasonably fast, isn’t a major concern nor is the file size. The biggest issue would be SRAM usage.

The length of a line is max. 40 chars max with about. There are about 7 fields, two of which are basically indices. The uC is supposed to retrieve the information it’s interested in by looking through these indices and seeing if it matches. For example, suppose the uC is needs information regarding something which is stored at index 5. It then needs to go here and retrieve the other 5 fields and display them on a screen. The uC requires ‘random’ access to the file – i.e. at one moment, it may need something from index 7 and at another it may need something from index 70.

As I understand, it would be better if this was a binary file with a strictly defined format (i.e. each field would be a fixed number of bytes). The advantage would be that the uC could seek directly to the byte it was interested in. For example, suppose each ‘record’ takes up 100 bytes (it will be a lot less, but just as an example). The uC knows the 2nd index would start from 100 (0-99 for the first record), the third from 200 etc.

So if it needs to access the 7th record, it just seeks to the 700th byte and retrieves the relevant information. Would the binary file approach be better than CSV? My main concern is SRAM usage and reasonable performance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T06:11:07+00:00Added an answer on May 30, 2026 at 6:11 am

    The binary file approach will be better for a number of reasons. One of the big pieces that you didn’t mention is that you will need to convert the string data in the fields to numeric data (at least for the indices, if not for the other data), which tends to be expensive in both compute time and in RAM. In addition, strtok of course requires searching through strings, and if you don’t know while line you want until you look at it, that’s a lot of searching through strings and converting them to integers for each line you read.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.