Hello all,
I have no experience converting text not in csv or other tabluar structure.
The only way I get data is in a text file like below.
I have tried many ways with this:
<script language="c#" runat="server">
public void Page_Load(object sender, EventArgs e)
{
string FILENAME = Server.MapPath("users_db_match.txt");
StreamReader objStreamReader = default(StreamReader);
objStrea<code><code><code></code></code></code>mReader = File.OpenText(FILENAME);
string contents = objStreamReader.ReadToEnd();
string strData = contents ;
char[] separator = new char[] { '\\' };
string[] strSplitArr = strData.Split(separator);
foreach (string arrStr in strSplitArr)
{
Response.Write(arrStr + " ");
}
But I am having no luck. Here is an example of the text structure:
# Senseless text
#
#
/from what folder
add comment="" customer=Multi disabled=no first-name=Joseph last- name=Won \
location="6333 Co. Rd 53 Where, AL 35045" name=joeandstacy password=\
took1 shared-users=3
add comment="" customer=Multi disabled=no email=carl_l@yahoo.com \
first-name=Carl last-name=Pop location=\
"6359 Co. Rd 53 Townin, AL 35045" name=carl_l password=\
20579 phone=205-755-5555 shared-users=3
The columns are immediately before the = and the data is immediately after. It also has \ breaking the text into new lines in the middle of a record.
Customer disabled email first-name
Multi no Carl
Multi no carl_l@yahoo.com Joseph
Am I even on the write track with the string functions? Once I get it converted to a csv or other format that excel can read I'll save the new structure as a file again. I know this is very complicated but would appreciate any help. Thanks.