|
|
Hi All,
I have an application that reads .csv data. My problem is that the is a value that is not read, it will read the number before the comma, but this is one number.
How do i make the app read the full number, e.g.: 1,093?
if (_lineItem == 12)
{
// the rows that will be added into the
// specified columns
dt.Rows.Add(new object[] { _dateParse, _casinoname, _line[3].Replace("\"", "").Replace("," , "")});
}
_lineItem++;
Thank you,
|
|
|
|
|
Can you post sample data from your csv file?
And do you have any idea how large the number would be ie minimum or maximum value?
जय हिंद
|
|
|
|
|
By sample you mean the fileds that is going to the app?
If so here is the data.
Day Visitors
Sunday, May 3, 2009 1,245
The app reads the Visitors Colomn.
|
|
|
|
|
ok that does not look like a CSV to me. Are you sure it's not tab delimited? If you want to parse that data i would suggest you split it using the index of the forth space value, which if that is all the data you have per line you can use LastIndexOf...
string visitors = line.Substring(line.LastIndexOf(' '));
...something like that anyway
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Do you know what CSV stands for?? Comma Seperated Values. So, if you put numbers formatted with commas in them into the CSV file, the reader will interpret it as two seperate values. You will have to jump through some custom written parsing logic that you have to write to detect this situation and reparse the line correctly. Or, go back to the export application as have it use a different delimiter, such as a Tab character, or not to format the numbers with commas.
|
|
|
|
|
Use Excel object in c# to read data from csv files. If there are fields that have comma in them, then they must be in double quotes.
Ahsan Ullah
Senior Software Engineer
MCTS 2.0
|
|
|
|
|
<fres:feinsearchresponse xmlns:fres="http://api.feinsearch.com/apiresponse">
- <fres:searchresults>
- <fres:searchresult>
<EIN>320095501</EIN>
</fres:searchresult>
</fres:searchresults>
</fres:feinsearchresponse>
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
Using eyes and brain.
I think you would like to rephrase your question.
|
|
|
|
|
I mean how can i parse it.,
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
One simple Google search returned these[^] many results. Are none of them fitting your needs?
जय हिंद
|
|
|
|
|
Actually it is output from a webservice but now i want to parse it. how do i ?
is this will work
XmlTextReader reader = new XmlTextReader("C:\\links.xml");
while (reader.Read())
{
XmlNodeType nodeType = reader.NodeType;
switch (nodeType)
{
case XmlNodeType.Element:
Console.WriteLine("Element name is {0}", reader.Name);
if (reader.HasAttributes)
{
for (int i = 0; i < reader.AttributeCount; i++)
{
reader.MoveToAttribute(i);
Console.WriteLine("Attribute is {0} with Value {1}: ", reader.Name, reader.Value);
}
}
break;
case XmlNodeType.Text:
Console.WriteLine("Value is: " + reader.Value);
break;
}
}
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
Mogaambo wrote: is this will work
you'll never know until you've tried it!
regards
|
|
|
|
|
|
System.Xml.Linq.XDocument
System.Xml.XmlDocument
Your question is immensely vague. It could cover any subject. Please, be precise
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Hi to all
I was interested in listing the sql servers available.
I found some code " using System.Runtime.InteropServices; "
Code is used like that for using windows dll.
For that we need to define the method that we want to use
as follows :
[DllImport("odbc32.dll")]
private static extern short SQLAllocHandle(
short hType,
IntPtr inputHandle,
out IntPtr outputHandle);
So I want to know that is there any tool to find the declaration of the functions available in the DLL. Please lemme know how can I find the tool to do the same ?
If I use IDSAM then it gives the same for .NET libraries only not for windows library.
Thanks in Avdvance
|
|
|
|
|
Not 100% sure.
1. You MUST know the programming language in which code was written for the DLL.
2. Dumpbin.exe[^] does that. Never used it though.
|
|
|
|
|
|
Have you thought about using built-in functionality available in the .NET framework, without having to P/Invoke first?
In the System.Data.Sql namespace (in the System.Data dll), there is a SqlDataSourceEnumerator class, that, "Provides a mechanism for enumerating all available instances of SQL Server within the local network."
Schmuli.
|
|
|
|
|
To see what functions are available you might be able to use the built in function of Visual studio, but it does depend on how the dll has been built, I would try that first though because its the easiest way.
There's also depends, it allows you to see whats going on in the dll http://www.dependencywalker.com/[^]
|
|
|
|
|
Hi
I am creating a windows application, it has two Forms one is Login Form which has two textBox Control for user name and password.....
i want to display his username in the Second Form label Control.....
Please give Some idea
Thanks in advance
|
|
|
|
|
hoh sorry..
i am working in WPF .net 3.5.
i was replied in that mood. it will work there..
extremly sorry mads115..
here better u may can use that in constructors, or by giving in the properties or in the public string and all
modified on Monday, June 1, 2009 7:04 AM
|
|
|
|
|
Hi iam getting this error near label1
'WindowsApplication1.Form2.label1' is inaccessible due to its protection level'
Form2 newform = new Form2();
newform.label1.Text = this.textBox1.Text;
|
|
|
|
|
|
You will as the controls are private - which is as they should be.
Better to create your own public properties and in the setters, validate the value if neeeded and uptdate the controls from there.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|