Not sure how to phrase this but PHP users will know what I mean.
I want to search for 1 2 and 3 and replace them with 5 6 and 7 respectively.
In PHP I might use str_replace(array(1,2,3) , array(5,6,7), string )
Replace by Array?
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 39
- Joined: Fri Apr 22, 2005 8:15 am
- Location: N. Ireland
- Contact:
-
- Posts: 39
- Joined: Fri Apr 22, 2005 8:15 am
- Location: N. Ireland
- Contact:
Came up with a solution. Maybe it'll help someone.
I put all the lookup list in a table in a database:
1 fred
2 bert
3 george
etc. I had 260-odd rows.
Then I filled another table like this:
INSERT INTO tbl_name SET other_ref = (SELECT uid FROM tbl_lookup WHERE name = 'fred') , etc. etc.
I was able to use normal regex to make the 25000 lines from csv to SQL as above. And now it's all working.
I put all the lookup list in a table in a database:
1 fred
2 bert
3 george
etc. I had 260-odd rows.
Then I filled another table like this:
INSERT INTO tbl_name SET other_ref = (SELECT uid FROM tbl_lookup WHERE name = 'fred') , etc. etc.
I was able to use normal regex to make the 25000 lines from csv to SQL as above. And now it's all working.
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm