Hi. I need to read several files without spaces or empty lines between characters.They can have different layouts, such as 1.txt, 2.txt or 3.txt:
I think you're asking how to read in a text file, ignoring spaces and empty lines. Please clarify your question so that we can help you better.
Here's something to get you started:
You could read in the entire file, then remove anything you don't want. The following post agrees with my experience that your application will probably run faster that way: Reading a file faster in C
If you agree with that approach, this next post will show you how to read the text file into a buffer, with some error handling: Reading the whole text file into a char array in C
Then you can use something like this to remove the spaces, and something similar for the extra new lines: Function to remove spaces from string/char array in C
I hope this helps get you started, and perhaps someone will find time today to post some code for you.