Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5964917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:31:10+00:00 2026-05-22T19:31:10+00:00

I have a strange issue in my Web Page, specifically with a text area

  • 0

I have a strange issue in my Web Page, specifically with a text area element that obtains the clipboard from the user.

The user perform a CTRL+V; and I created a event to get the data with the event KeyUp.

…this works fine…

But, when I try to divide by each “row” of this textarea; start the problems…
The input can be like this example:

excel

The data reads something like that:

Row1[0][HT]Row1[1][LF]”Row2[0] Comment line 1[LF]Row2[0] Comment line 2″[HT]Row2[1]

Where:
[HT] means {Tab}
[LF] means {New line}

I use:

var myData = document.getElementById("TextAreaElement").value;
var vArray = myData.split(/\n/);

But this array return me 3 lines…

debug


Somebody knows any solution or alternative way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:31:11+00:00Added an answer on May 22, 2026 at 7:31 pm

    Well, I don’t find the way to work with some regular expression or a javascript method (I believe that can do it). I worked a different way to split the info.

    I used AJAX to send this information to the server and perform the split in VB.
    In resume:

    1. I get the max columns (split by tabs).

    2. Get and evaluate each value of the array of tabs.

    3. If start with double quotes, tried to find the end of the double quotes (before that, replaced the mid double quotes with a unique text)

    4. Every time that evaluated an item of the original Array, I deleted each item (Always evaluate the item 0)…

    5. If find a new line (final of the row), only removed the text of the “final column” of the previous row.

    I hope help to someone with the same problem. Cheers.

    Here is the code:

    Public Function TEST(ByVal pText As String) As String
        Try
            Dim vText As String = pText
    
            Dim vArray As New ArrayList
            vArray.AddRange(vText.Split(vbNewLine))
            Dim vActualIndex As Integer = 0
    
            Dim vMaxColumns As Integer = 0
    
            For Each vArrayItem In vArray
                If vArrayItem.Split(vbTab).Length > vMaxColumns Then
                    vMaxColumns = vArrayItem.Split(vbTab).Length
                End If
            Next
    
            Dim vActualArray(vMaxColumns - 1) As String
            vArray = New ArrayList
            vArray.AddRange(vText.Split(vbTab))
    
            Dim vLen As Integer = vArray.Count
            Dim vNewArray As New ArrayList
    
            vActualIndex = 0
    
            Do While vArray.Count <> 0
                If vArray(0).Split(vbNewLine).Length = 1 Then
                    vActualArray(vActualIndex) = vArray(0)
                    vActualIndex += 1
                Else
                    If vArray(0).Split(vbNewLine)(0).ToString.StartsWith("""") Then
                        vArray(0) = Mid(vArray(0), 2).Replace("""""", "*_IDIDIDUNIQUEID_*")
    
                        If InStr(vArray(0), """" & vbNewLine) <> 0 Then
                            vActualArray(vActualIndex) = Mid(vArray(0), 1, InStr(vArray(0), """" & vbNewLine) + 1)
                            vArray(0) = Mid(vArray(0), InStr(vArray(0), """" & vbNewLine) + 3)
    
                            vActualArray(vActualIndex) = vActualArray(vActualIndex).ToString.Replace("*_IDIDIDUNIQUEID_*", """""")
                            vArray(0) = vArray(0).ToString.Replace("*_IDIDIDUNIQUEID_*", """""")
    
                            vActualIndex += 1
    
                            GoTo Skip_remove
                        End If
    
                        vArray(0) = vArray(0).ToString.Replace("*_IDIDIDUNIQUEID_*", """""")
                        vActualArray(vActualIndex) = vArray(0)
                        vActualIndex += 1
                    Else
                        vActualArray(vActualIndex) = vArray(0).Split(vbNewLine)(0)
                        vActualIndex += 1
    
                        vArray(0) = vArray(0).ToString.Substring(vArray(0).Split(vbNewLine)(0).ToString.Length + 2)
                        GoTo Skip_remove
                    End If
                End If
    
                vArray.RemoveAt(0)
    

    ‘ This is a label in VB code
    Skip_remove:

                If vActualIndex >= vMaxColumns Then
                    vNewArray.Add(vActualArray)
    
                    ReDim vActualArray(vMaxColumns - 1)
    
                    vActualIndex = 0
                End If
            Loop
        Catch ex As Exception
            Return ""
        End Try
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange issue: I am using SPContext.Current.Web in a .aspx page, but
I have a strange issue that has arisen recently: Whenever I enter text, even
I have this strange issue with my web app. You see, I'm using jQuery
I am facing a very strange issue. I have a SharePoint webpart that displays
I am trying to debug a strange issue with users that have LogMeIn installed.
I have a strange, sporadic issue. I have stored procedure that returns back 5
I have noticed a strange thing that happens on my web app when the
I have a web application that stores a lot of user generated files. Currently
I have a strange issue that I am asked to make a Spring MVC
I'm having a strange issue with my project. It was a Web Site that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.