• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Replace function is confusing

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

Quick one for you, I have a .csv file imported into a table in SQLite3 with 5 columns
User_Name,Email, x ,x, x

I would love to know how to edit the 19,000 email addresses in col b, to omit '@Domain.com'

lets say my example is 19000 users of gmail.com, so the string reads [email protected] , how in this instance can I select '@gmail.com' and replace it with a blank space?

for clarity I want 'col b' to read 'first.last' without the email extension.

I've been digging around a little but I can't find a clear set of instructions for my example.

any help?
 
Marshal
Posts: 80645
473
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you using BigTable or have you found an inappropriate forum? Is it possible for the at sign @ to appear twice in a valid email address? Are you using ordinary Java®?
If you are using ordinary Java®:-
Since @ isn't a metacharacter, you might try myEmailAddress.split("@")[0] or myEmailAddress.substring(0, myEmailAddress.indexOf("@")) or similar. Adding spaces should be easy.
 
Vincent Tyson
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am in the wrong forum mate,

I was looking for an SQLite3 forum !

Apologise
 
Campbell Ritchie
Marshal
Posts: 80645
473
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apology accepted. Let's try the general SQL/JDBC forum. And my suggestions earlier aren't much use to you, are they?
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you importing the CSV?
Is it the SQLite import, or via some other code (eg Java's JDBC)?
 
reply
    Bookmark Topic Watch Topic
  • New Topic