7 Replies - 2975 Views - Last Post: 18 July 2008 - 12:42 PM Rate Topic: -----

#1 juancho2114  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 18-July 08

split string not working in server

Post icon  Posted 18 July 2008 - 07:41 AM

Hi, i have an web site (ASPX - C#) that split a tab delimiter file.

On the local machine, it works fine, it split the file and reads it correctly. I have done it in several ways.

Whe i publish the web site in the server and use the web site, the split method doesnīt work.

Anyone have any ideas?

This is the code:
 char[] delimiterChars = {Convert.ToChar(9) };
					
 string[] words = strLine.Split(delimiterChars);

I have also done in this way and works locally:
objCulture.NumberFormat.NumberGroupSeparator = ",";
objCulture.NumberFormat.NumberDecimalSeparator = ".";
objCulture.TextInfo.ListSeparator = "" + Convert.ToChar(9);

char[] delimiterChars = {char.Parse(objCulture.TextInfo.ListSeparator)};
string[] words = strLine.Split(delimiterChars);


Is This A Good Question/Topic? 0
  • +

Replies To: split string not working in server

#2 djkitt  Icon User is offline

  • D.I.C Head

Reputation: 29
  • View blog
  • Posts: 189
  • Joined: 22-May 08

Re: split string not working in server

Posted 18 July 2008 - 08:15 AM

View Postjuancho2114, on 18 Jul, 2008 - 09:41 AM, said:

Hi, i have an web site (ASPX - C#) that split a tab delimiter file.

On the local machine, it works fine, it split the file and reads it correctly. I have done it in several ways.

Whe i publish the web site in the server and use the web site, the split method doesnīt work.

Anyone have any ideas?


In what way doesn't it work? What does the split return?
Was This Post Helpful? 0
  • +
  • -

#3 juancho2114  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 18-July 08

Re: split string not working in server

Posted 18 July 2008 - 08:20 AM

View Postdjkitt, on 18 Jul, 2008 - 08:15 AM, said:

View Postjuancho2114, on 18 Jul, 2008 - 09:41 AM, said:

Hi, i have an web site (ASPX - C#) that split a tab delimiter file.

On the local machine, it works fine, it split the file and reads it correctly. I have done it in several ways.

Whe i publish the web site in the server and use the web site, the split method doesnīt work.

Anyone have any ideas?


In what way doesn't it work? What does the split return?


in both ways it works, even using '\t' works on the local machine. I access the positions of the output array directly but i canīt get the positions. I insert the results in a datatable, row by row but when i run it on the server, the datatable appears in blank.


Thanks.
Was This Post Helpful? 0
  • +
  • -

#4 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: split string not working in server

Posted 18 July 2008 - 08:26 AM

Have you verified that the text file always has Tab as the delimiter?

Are you writing to the file at any point that might be removing the delimiters?
Was This Post Helpful? 0
  • +
  • -

#5 juancho2114  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 18-July 08

Re: split string not working in server

Posted 18 July 2008 - 08:45 AM

View Postjayman9, on 18 Jul, 2008 - 08:26 AM, said:

Have you verified that the text file always has Tab as the delimiter?

Are you writing to the file at any point that might be removing the delimiters?


Thatīs preciselly the issue. I run the web site on the local machine and it reads the text file y shows it on the dataGrid.
Then, i publish the site and posted on the serverīs iis.
Access the web site on the server, use the same file, but the application doesnīt read the file.

I have to read multiple types of files, comma separated, etc. and all works fine in both, the local machine and the server, the only exception is the tab separated file.

thanks.
Was This Post Helpful? 0
  • +
  • -

#6 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: split string not working in server

Posted 18 July 2008 - 09:08 AM

Ok, but you didn't answer my question.

At any time, is a new text file being written, while your application is running on the server?

Is it possible that the delimiter is being removed?
Was This Post Helpful? 0
  • +
  • -

#7 juancho2114  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 18-July 08

Re: split string not working in server

Posted 18 July 2008 - 09:10 AM

View Postjayman9, on 18 Jul, 2008 - 09:08 AM, said:

Ok, but you didn't answer my question.

At any time, is a new text file being written, while your application is running on the server?

Is it possible that the delimiter is being removed?



Hi, no, the file is only read. In the local machine, i run it step by step and i can see the \t in each row.

Thanks
Was This Post Helpful? 0
  • +
  • -

#8 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: split string not working in server

Posted 18 July 2008 - 12:42 PM

Can't you just make it a comma separated file, like the others?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1