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

  • Home
  • SEARCH
  • 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 7175131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:13:06+00:00 2026-05-28T16:13:06+00:00

would somebody tell me, how to from text in variable like: >Hello World text,1000

  • 0

would somebody tell me, how to from text in variable like:

>Hello World
text,1000
text2,200

read:
1. line – if in line is > and line isn’t logner than 50 chars then read, if not – go to next line
(part of this checking is:

if string.sub(tekst, 1, 1) == '>' then
    ...
end

but there is nothing about checking lenght of line.

next lines – impart text by “,” and first get text from before “,” then get text from after “,” to the different vars (to analyse it by another part of script)

I’ll be very grateful

  • 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-28T16:13:07+00:00Added an answer on May 28, 2026 at 4:13 pm

    Your not entirely clear on what to do with the matched string (between > and the end of the line), as read is kind of generic, I just put it in a table.

    s=[[
    >Hello World
    text,1000
    >A line that is way too long to fit in this small space won't be accepted in the table.
    text2,200
    >Some text on the last line]]
    
    t={}
    for match in s:gmatch('>([^\n]+)') do
        if #match<50 then
            t[#t+1]=match
            print(match)
        end
    end
    

    This depends also on which character(s) represent a line ending in the string. possibilities are: \n (UNIX, Mac, and the rest of the sane world) or \r\n (Windows)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know your experience when you need to take over somebody
I have a listview with some items. I would like to get the text
Can somebody tell me what regex I would need to filter out ---> %,
I would really appreciate if somebody could tell me why compilation of this program:
I would appreciate it if somebody could tell me how to bind a listbox
Would somebody care to help me out with a regex to reliably recognize and
When and why would somebody do the following: doSomething( (MyClass) null ); Have you
i would to know if somebody knows a methodology or whatever that be capable
If somebody may knows a blog posting with a basic example, that would help
I'm not the best at PHP and would be extremely grateful if somebody could

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.