multiple files on sd card using arduino

i am able to write to a single file on sd card but i want to split the string as given below.

How can i make multiple files from a string i am getting from ethernet??

I am getting a string like "1-200-0-0-1-2-3-4-5"

i want text files like

conf1 with data "1-200-0-0-1" conf2 with data "1-200-0-0-2" conf3 with data "1-200-0-0-3"

and so on.

please help as i am able to read and write to single file.

Does that string has a specified format ? I mean, how big can the values be, could there be text or something else.

Perhaps it is best when the string is converted into integers, that makes it easier to use them for the filename and so on. You could read the string and use sscanf to extract the values. Or, you can use Serial.parseInt and convert the values during reading the Serial data.

To create text for the filename and the contents of the files, you can use sprintf to convert the integers into text.

It is not possible to create or write multiple files at once. You can create one file, write the data and close that file. After that, do the next file. And so on.

yes, there is a format "e-r-g-b-led_no" actually i am working on led strip on which i have to give effects i.e. glow and blink the r,g,b are the color values. led_no are the LEDs with this effect and color.

Requirement:- User gives me a string with these values respectively and i have to make different files for each LED with it's color and effect which i can use to glow respective LED once it's values are stored respective conf.led_no.txt file.

Okay, I think that it would indeed be good to convert that to a number of integers.

Did you read what 'sscanf', 'sprintf' and 'Serial.parseInt' do ? I'm on my tablet now, so I can't insert all the links, you have to use Google.

P.S.: This topic might be in the wrong forum section, a moderator might move it. Do you see "updated topics" on right-top of this page ? use that to find your topics.