Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Replace function is confusing

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • 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 first.last@gmail.com , 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: 65821
250
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
I am in the wrong forum mate,

I was looking for an SQLite3 forum !

Apologise
 
Campbell Ritchie
Marshal
Posts: 65821
250
  • Mark post as helpful
  • send pies
  • 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: 4275
47
  • Mark post as helpful
  • send pies
  • 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)?
 
Hang a left on main. Then read this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!