Parker Software Ltd Homepage
Forum Home Forum Home > Email2DB Email Parser > Samples
  New Posts New Posts RSS Feed: CSV process - using repeating items
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

CSV process - using repeating items

 Post Reply Post Reply Page  <12
Daniel View Drop Down
Admin Group
Admin Group
Technical Director

Joined: 19 Dec 2006
Location: Stoke-on-Trent
Posts: 879
Post Options Post Options   Quote Daniel Quote  Post ReplyReply Direct Link To This Post Topic: CSV process - using repeating items
    Posted: 17 Aug 2011 at 2:51pm
If you want to ignore X lines from the script, first setup an empty field extraction above the CSV Line extraction, and name it LineCount.
Now, modify the CSV extraction to:
Sub Main()

Dim vbQuote As String
Dim arr As Variant
Dim mod_ans As Integer
vbQuote = Chr(34)
If Val(Fields_value("LineCount")) < 18 Then
Email2DBExtract = ""
End If

If InStr(1, Email2DBExtract, vbQuote) > 0 Then
arr = Split(Email2DBExtract, vbQuote)

For idx = LBound(arr) To UBound(arr)
If idx Mod 2 = 1 Then
arr(idx) = Replace(arr(idx), ",", "[COMMA]")
End If
Next idx

Email2DBExtract = Join(arr, "")
End If

If Left(Email2DBExtract, 1) = "," Then Email2DBExtract = " " & Email2DBExtract
Do While InStr(1, Email2DBExtract, ",,") > 0
Email2DBExtract = Replace(Email2DBExtract, ",,", ", ,")
Fields_Value("LineCount") = Cstr(Val(Fields_value("LineCount")) + 1)
End Sub
This will send blank data in the pass to for lines up to 18.

Edited by Daniel - 17 Aug 2011 at 5:19pm
Daniel Tallentire
Parker Software
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

This page was generated in 0.094 seconds.
These are the forums for Parker Software, developers of Live Chat Software: WhosOn and Email Automation Software: Email2DB.