Knowledge Management

How do you remove the first letter of a value?

brienhawker
Explorer

I have a list of usernames of varying lengths. I just need to have the first letter of each username removed. Im guessing it has something to do with ltrim but I dont know what to put in to remove the first random character.

0 Karma
1 Solution

vnravikumar
Champion

Hi

try this

|makeresults |eval msg="sample" | eval result =replace(msg,"^.","")

View solution in original post

VatsalJagani
Motivator

Hi @brienhawker,

 .... | eval new_username=substr(username, 1)

vnravikumar
Champion

Hi

try this

|makeresults |eval msg="sample" | eval result =replace(msg,"^.","")

View solution in original post

woodcock
Esteemed Legend

Yes, ltrim can do it but get used to using sed like this:

... | rex field=username mode=sed "s/^.//"
Register for .conf21 Now! Go Vegas or Go Virtual!

How will you .conf21? You decide! Go in-person in Las Vegas, 10/18-10/21, or go online with .conf21 Virtual, 10/19-10/20.