a consultancy on asp/vbscript

Results 1 to 2 of 2

Thread: a consultancy on asp/vbscript

  1. #1
    Join Date
    Dec 1969

    Default a consultancy on asp/vbscript

    Last friday I got some usefull inputs but I need to verify what I learned, also because for some admin problem I cannot test my software till next wednesday.<BR><BR>Here is my problem: I read a csv file (comma delimited) and I need to:<BR>drop all the "&#039;" , convert "=" to "~", drop commas and " every time they are inside the combination ,"...........",<BR><BR>My original approach was to scan the file several times, byte by byte, storing the file on an output file and then reading the file again to execute the following manipulation. Thanks to the your help I developed this new approach for which I would like an evaluation. <BR>Also I would like to know who is it possible to read the e-mails that I exchanged with you few days ago. They do not seem any more available.<BR><BR>Here is my software. Thanks in advance for tthe support. <BR>DIM strLINE, arrFIELDS, strFIELD<BR>Y = chr(34) : TILDA = chr(126) &#039; Y is " (double apix) TILDA is ~ (about) U is &#039; (apix)<BR>i = 1 : U = chr(39) &#039; C is , (comma) Q is ? (question mark) E is = (equal)<BR>C = chr(44) : Q = chr(63) : E = chr(61) <BR> <BR>DO WHILE User_input_file.AtEndOfStream &#060;&#062; True <BR> <BR>strLINE = User_input_file_Readline() &#039;Get a line at a time into a string<BR>arrFIELDS = split(strLINE, C)<BR>for each strFIELD in arrFIELDS<BR> strFIELD = trim(strFIELD) &#039;Elim spaces and . . . <BR>strLINE = join(strFIELDS, C) &#039; re-join the segments <BR>steLINE = replace(strLINE, U, "") &#039;Elimination of apix<BR>strLINE = replace(strLINE, C & Y, Y & Q) &#039;prep comma and double apix (e.g.: ," and ", replaced by "? and ?") <BR>strLINE = replace(strLINE, Y & C, Q & Y) &#039; for double apix elimination and set of commas to restate the csv file structure <BR>arrFIELDS = split(strLINE, Y) <BR>for each strFIELD in arrFIELDS<BR> if left(strFIELD, 1) = Q then &#039;If string starts with ? <BR> strFIELD = replace(strFIELD, C, "") &#039;Suppress commas inside ?. . . .? <BR> strFIELD = replace(strFIELD, Q, C) &#039;Replace ? by , <BR> end if<BR>strLINE = join(arrFIELDS) &#039;Re-join the string <BR>strLINE = replace(strLINE, E, TILDA) &#039;Replace = by ~ <BR><BR>User_input_file_V2_Writeline() &#039;Write the output line <BR>

  2. #2
    Join Date
    Dec 1969

    Default That code doesn't work...

    ...so I know you aren&#039;t telling us the whole story.<BR><BR>You have a FOR EACH in there but no NEXT to match it, so I *know* that the code isn&#039;t working yet.<BR><BR>***********<BR><BR>TO see postings from prior days, click on the LINK at the top of the message area that says<BR> See posts from 11/23/2003 to 11/23/2003<BR>And then click on the similar links to keep going backwards by days.<BR><BR>Or use the SEARCH link at the very top of the page and search for posts that YOU made.<BR><BR>*********<BR><BR>I don&#039;t understand how you will ever be able to drop the " when it appears in side "......". How will you *KNOW* WHICH of the " marks is the right one????<BR><BR>Suppose the text is:<BR> 123,"He said,"What about this?",with concern",998<BR><BR>????<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts