✅ Program csv extraction
I created a program but when it extracts as a csv file its got a  symbol and one of the values extract into two separate cells
36 Replies
For the first issue, my bet is encoding differences. Make sure the encodings match, or convert them if needed. Could be the CSV is encoded in ASCII, and the output wants UTF8, for example. Or the other way around.
For the other issue, could it be that a comma is used for a thousands separator?
1,400
?
Because "CSV" stands for "comma-separated values", so
will be treated as
i tried removing the comma but it made it so it would all be in the first cell
Oh so just making it a quote would work
yes because its one way CSV uses to ignore a comma within a column
ideally you should use a library like CSVHelper
it will make your life easier
Thank you I don’t really do a lot of projects where they extract
Use the /close command to mark a forum thread as answered
what would i do about the A as i have no idea what that is even ment to be
its probably currency symbol
you're not using the right encoding
so without more details about how you're writing that file hard to tell
can i share my code on this thread
$paste to the site below if possible
If your code is too long, you can post to https://paste.mod.gg/ and copy the link into chat for others to see your shared code!
you can also add multiple files to it if u have to
no zippped files
BlazeBin Basic - mwphqrmsvsaf
A tool for sharing your source code with the world!
leowest
REPL Result: Success
Result: string
Quoted by
<@1102729783969861782> from #bot-spam (click here)
Compile: 326.461ms | Execution: 44.050ms | React with ❌ to remove this embed.
as you can see C2 is a currency formatter, it adds the symbol
so I assume your streamwriter is not using the proper encoding for it to display
are you using .net framework?
yea on visual studio
oh no sorry im just doing console app
try changing this
to
on visual studio
yes but if u right click your project in the solution explorer of visual studio and click properties
does it say .net framework or .net 8
oh it says net framework
ok, try what I said above
will do thank you
its now saying it cant convert from string to system.io.stream
can you show your new code
BlazeBin Basic - tuplkyyxevwx
A tool for sharing your source code with the world!
this is it now
ah right my bad you're on .net framework
it is
sorry needs to be false in your case
u also need to change
writer.WriteLine($"{expense.Key},\"{expense.Value:C2}\"");
i changed it its all worked but the remaining ballance is still messing up where it displays like this
BlazeBin Basic - tefvworjmsog
A tool for sharing your source code with the world!
well yeah
u'r not adding "" for the remaining
and its also missing a comma
oh i thought i was changing it to that what you sent
u did
but did u forgot what we talked about
you're not adding neither the comma nor the quotes for the remaining
so how do u expect it to print right
I pushed u half way u need to push your self the other half 🙂
i will do my best thank you for the help