Question: i'm converting xls to csv. Since i'm having commas in a single column, i'm getting csv as below: 

```
AMP FAN,Yes,Shichi,PON Seal,,"Brass, Silver"
AMP FAN,Yes,Shichi,PON Seal,,"Platinum, Gel"

```

If you see double quote is coming for the last column as it has comma inside. Now i'm reading this csv in **tcl** file and i'm sending to my target system. In target system this value is getting saved with double quotes (means exactly like **"Brass, Silver"**). But the user doesn't want that double quotes. So i want to set like **Brass, Silver** . is there any way i can avoid that double quotes. below is the current script i'm using.

```
while {[gets $fileIn sLine] >= 0} {
        #using regex to handle multiple commas in a single column

        set matches [regexp -all -inline -- {("[^\"]+"|[^,]*)(?:$|,)} $sLine]
        set lsLine {}
        foreach {a b} $matches {lappend lsLine $b}
            set sType [lindex $lsLine 0]    
            set sIsOk [lindex $lsLine 1]
            set sMaterial [lindex $lsLine 5]

            #later i'm setting sMaterial to some attribute
    }

```

Kindly help me.

Note : I will not be able to use csv package as the user don't have that in their environment and i can't add there myself.

Answer: 
I think this should help you:

```
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
    int x = Math.round(ev.getX());
    int y = Math.round(ev.getY());
    for (int i = 0; i < getChildCount(); i++) {
        if (isEditText(x, y, getChildAt(i))) {
            return true;
        }
    }

    return true;
}

public boolean isEditText(int x, int y, View view) {
    if (view instanceof ViewGroup) {
        for (int i = 0; i < getChildCount(); i++) {
            if (isEditText(x, y, ((ViewGroup) view).getChildAt(i))) {
                return true;
            }
        }
    } else if (view instanceof EditText) {
        if (x > view.getLeft() && x < view.getRight() && y > view.getTop() && y < view.getBottom()) {
            return true;
        }
    }
    return false;
}

```
Put the given Kotlin code in your activity.

```
override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
    val x = ev.x.roundToInt()
    val y = ev.y.roundToInt()
    val rootView = window?.decorView?.rootView
    if (rootView is ViewGroup) {
        for (i in 0 until rootView.childCount.orZero()) {
            if (isEditText(x, y, rootView.getChildAt(i))) {
                return super.dispatchTouchEvent(ev)
            }
        }
    }
    hideKeyboard()
    return super.dispatchTouchEvent(ev)
}

fun isEditText(x: Int, y: Int, view: View): Boolean {
    if (view is ViewGroup) {
        for (i in 0 until view.childCount) {
            if (isEditText(x, y, view.getChildAt(i))) {
                return true
            }
        }
    } else if (view is EditText || view is TextInputLayout) {
        val rect = Rect()
        view.getGlobalVisibleRect(rect)
        if (x > rect.left && x < rect.right && y > rect.top && y < rect.bottom) {
            return true
        }
    }
    return false
}

```

It will check each nested view and if the touched view is EditText or TextInputLayout then it will not hide the keyboard, for all other cases, it will hide the keyboard.

It works for EditText in fragments as well.