This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using lookup tables generated by excel

Hi All
I'm experimenting with tables generated by microsoft excel, i copy and paste right into my keil compiler to use in an array, the problem is I get the table pasted with <CR> separator, is there a way to replace this carriage return by a comma so that I can paste the table right into my array, saving me alot of time since my tables are quite large?
Regards
Mahmood

Parents
  • :1,$s/^V^M/,/g


    Actually, I said that just for the line noise factor. I don't even use vi.

    Check your editor documentation. It's bound to have a global search-and-replace function. And if it's at all a decent editor, it has a way to let you specify non-printable characters like the CR (or CR LF). If your editor doesn't have such a feature, get another editor!

    You could also run the file through a tool like awk (or sed or perl) to reformat it before pasting it into your C source.

Reply
  • :1,$s/^V^M/,/g


    Actually, I said that just for the line noise factor. I don't even use vi.

    Check your editor documentation. It's bound to have a global search-and-replace function. And if it's at all a decent editor, it has a way to let you specify non-printable characters like the CR (or CR LF). If your editor doesn't have such a feature, get another editor!

    You could also run the file through a tool like awk (or sed or perl) to reformat it before pasting it into your C source.

Children