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 7007137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:34:06+00:00 2026-05-27T21:34:06+00:00

How can I modify this data: (13, ‘µµ+3 ‘, ‘Miecz +3’, 1, 0, 0,

  • 0

How can I modify this data:

(13, 'µµ+3                    ', 'Miecz +3', 1, 0, 0, 2, 32, 1, 16, '', 100, 0, 14, 4, 0, 15, 1, 0, 0, 0, 7, 22, 0, 0, 0, 0, 0, 15, 19, 13, 15, 21, -1, -1, -1, -1, -1, -1, 0, 1, 0),
(14, 'µµ+4                    ', 'Miecz +4', 1, 0, 0, 2, 32, 1, 16, '', 100, 0, 15, 5, 0, 15, 1, 0, 0, 0, 7, 22, 0, 0, 0, 0, 0, 15, 19, 13, 15, 28, -1, -1, -1, -1, -1, -1, 30, 1, 0),
(15, 'µµ+5                    ', 'Miecz +5', 1, 0, 0, 2, 32, 1, 16, '', 100, 0, 16, 6, 0, 15, 1, 0, 0, 0, 7, 22, 0, 0, 0, 0, 0, 15, 19, 13, 15, 35, -1, -1, -1, -1, -1, -1, 40, 1, 0),
(16, 'µµ+6                    ', 'Miecz +6', 1, 0, 0, 2, 32, 1, 16, '', 100, 0, 17, 7, 0, 15, 1, 0, 0, 0, 7, 22, 0, 0, 0, 0, 0, 15, 19, 13, 15, 42, -1, -1, -1, -1, -1, -1, 50, 1, 0),
(17, 'µµ+7                    ', 'Miecz +7', 1, 0, 0, 2, 32, 1, 16, '', 100, 0, 18, 8, 0, 15, 1, 0, 0, 0, 7, 22, 0, 0, 0, 0, 0, 15, 19, 13, 15, 49, -1, -1, -1, -1, -1, -1, 65, 1, 0),
(18, 'µµ+8                    ', 'Miecz +8', 1, 0, 0, 2, 32, 1, 16, '', 100, 0, 19, 9, 0, 15, 1, 0, 0, 0, 7, 22, 0, 0, 0, 0, 0, 15, 19, 13, 15, 56, -1, -1, -1, -1, -1, -1, 80, 1, 0),
(19, 'µµ+9                    ', 'Miecz +9', 1, 0, 0, 2, 32, 1, 16, '', 2000, 0, 0, 0, 0, 15, 1, 0, 0, 0, 7, 22, 0, 0, 0, 0, 0, 15, 19, 13, 15, 63, -1, -1, -1, -1, -1, -1, 100, 1, 0),
(20, 'Ŕĺ°Ë+0                  ', 'Dlugi Miecz +0', 1, 0, 0, 2, 32, 1, 16, '', 400, 0, 21, 1, 0, 15, 1, 5, 0, 0, 7, 27, 0, 0, 0, 0, 0, 13, 15, 15, 19, 0, -1, -1, -1, -1, -1, -1, 0, 1, 0),
(21, 'Ŕĺ°Ë+1                  ', 'Dlugi Miecz +1', 1, 0, 0, 2, 32, 1, 16, '', 400, 0, 22, 2, 0, 15, 1, 5, 0, 0, 7, 27, 0, 0, 0, 0, 0, 13, 15, 15, 19, 7, -1, -1, -1, -1, -1, -1, 0, 1, 0),
(22, 'Ŕĺ°Ë+2                  ', 'Dlugi Miecz +2', 1, 0, 0, 2, 32, 1, 16, '', 400, 0, 23, 3, 0, 15, 1, 5, 0, 0, 7, 27, 0, 0, 0, 0, 0, 13, 15, 15, 19, 14, -1, -1, -1, -1, -1, -1, 0, 1, 0),

Into a query, like this:

UPDATE `itemproto`
SET `name` = 'µµ+3'
WHERE `id` = 13;

UPDATE `itemproto`
SET `name` = 'µµ+4'
WHERE `id` = 14;

…

UPDATE `itemproto`
SET `name` = 'Ŕĺ°Ë+2'
WHERE `id` = 22;

..etc. There are hundreds of data, I’ve just gave you a little cut, because file weight is a some nice MB. But ok, let me explain, what do I want to reach:

Fe. there is a line like this…

(13, 'µµ+3                    ', 'Miecz +3', 1, 0, 0, 2, 32, 1, 16, '', 100, 0, 14, 4, 0, 15, 1, 0, 0, 0, 7, 22, 0, 0, 0, 0, 0, 15, 19, 13, 15, 21, -1, -1, -1, -1, -1, -1, 0, 1, 0),

Then the script should rewrite the above line into a query:

UPDATE `itemproto`
SET `name` = 'µµ+3'
WHERE `id` = 13;

You just need the following info from each line to build a query:

(13, 'µµ+3 ' , etc….

I think it can be done using preg_replace or preg_match, but I have no idea about the regex.

Anyway, I will try to explain one more time in case if you still don’t get it:

I got hundreds of lines like this (with random names, numbers) :

(13, 'µµ+3                    ', 'Miecz +3', 1, 0, 0, 2, 32, 1, 16, '', 100, 0, 14, 4, 0, 15, 1, 0, 0, 0, 7, 22, 0, 0, 0, 0, 0, 15, 19, 13, 15, 21, -1, -1, -1, -1, -1, -1, 0, 1, 0),

Now the script should grep this info: (13, 'µµ+3, and based on these info, should build the following query:

UPDATE `itemproto`
SET `name` = 'µµ+3'
WHERE `id` = 13;

And thats all.

I know its a little bit complicated, but as you know, everything can be done using PHP. So thats why I’m using it, but um, in case if you still don’t understand the question, feel free to post a comment, and I’ll reply!

  • 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-27T21:34:07+00:00Added an answer on May 27, 2026 at 9:34 pm

    A somewhat simplistic solution:

    $data = file("path/to/file.txt"); // returns an array of the lines
    foreach($data as $key => $val){
        $temp = explode(',', $val);
        $id = trim(substr($temp[0], 1));
        $name = trim($temp[1]);
        $query = "UPDATE `itemproto`
            SET `name` = '$name'
            WHERE `id` = $id;";
        // Do work here
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there anyway I can modify this code example #include <stdlib.h> #include <iostream> class
How can I modify this: /services/type/single_dwelling/ to this: /ajax/services/single_dwelling/development Currently I have: linkUrl =
Looking at this jQuery example, how can I modify the code so that it
I have an app that can make modify images. In some cases, this makes
Suppose I have a table that contains valid data. I would like to modify
I have a client application that scrapes data into a raw table. This client
I know I can modify what default data entry areas show up when I
I have this script: select name,create_date,modify_date from sys.procedures order by modify_date desc I can
Can anybody confirm or deny that I can modify default styles provided by StyleCop
I have a form where users can modify a collection of objects using a

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.