Remove last 4 digits

Hi all,
I want to remove last 4 digits from my numerical no. how can i do this?
Plz help me.

hi
good
w_level_03 = strlen( W_STRING ).
lv_offset = w_level_03 - 4.
w_string2 = w_string +(lv_offset).
or
w_string2 = w_string +0(lv_offset).
Eg:-
str = "testing1234".
int offset = strlen( str ) - 4.
str = str+0(offset).
thanks
mrutyun^

Similar Messages

  • Best way to remove last line-feed in text file

    What is the best way to remove last line-feed in text file? (so that the last line of text is the last line, not a line-feed). The best I can come up with is: echo -n "$(cat file.txt)" > newfile.txt
    (as echo -n will remove all trailing newline characters)

    What is the best way to remove last line-feed in text file? (so that the last line of text is the last line, not a line-feed). The best I can come up with is: echo -n "$(cat file.txt)" > newfile.txt
    (as echo -n will remove all trailing newline characters)
    According to my experiments, you have removed all line terminators from the file, and replaced those between lines with a space.
    That is to say, you have turned a multi-line file into one long line with no line terminator.
    If that is what you want, and your files are not very big, then your echo statement might be all you need.
    If you need to deal with larger files, you could try using the 'tr' command, and something like
    tr '
    ' ' ' <file.txt >newfile.txt
    The only problem with this is, it will most likely give you a trailing space, as the last newline is going to be converted to a space. If that is not acceptable, then something else will have to be arranged.
    However, if you really want to maintain a multi-line file, but remove just the very last line terminator, that gets a bit more complicated. This might work for you:
    perl -ne '
    chomp;
    print "
    " if $n++ != 0;
    print;
    ' file.txt >newfile.txt
    You can use cat -e to see which lines have newlines, and you should see that the last line does not have a newline, but all the others still do.
    I guess if you really did mean to remove all newline characters and replace them with a space, except for the last line, then a modification of the above perl script would do that:
    perl -ne '
    chomp;
    print " " if $n++ != 0;
    print;
    ' file.txt >newfile.txt
    Am I even close to understanding what you are asking for?

  • Extracting last digits in message mapping

    Hi
    Is there a standard function for extracting last digits of a field value?
    Thanks

    Pratichi,
    I don't believe there is any standard function. You need to write simple UDF in order to achieve it. Like below sample code...
    String ret = a.substring(a.length()-4, a.length();
    return ret;

  • Remove last selection for parameters

    Hello expert,
    I have a webi report with multiple parameter inherited from store procedure on which universe is built up. how can I remove last select variant for all parameters ? I mean for every running, I want to select parameters from scratch. but currently in my report, parameters display last selection.
    Many Thanks,

    Hello,
    I believe if you go into the universe and right click on the stored procedure, it should give you an edit option. Then you should be able to select the parameter and change it to "Prompt for a value" or something like that. There are probably some other posts regarding how to do this. I am not sure I have it all correct since I don't have BO up right now, but pretty sure I have done it before.
    Thanks

  • Remove Last part

    i have this data
    ELECT  [item_id]  ,[f2] from [Regions]
    1. ُEgypt
    1.1. Cairo
    1.1.21. New Cairo
    i want to remove last part 
    like in Egypt remove 1.
    and on Cairo remove  last 1.
    and on New Cairo last 21.

    Try:
    DECLARE @City TABLE ( CityName varchar(100));
    INSERT @City VALUES
    ('1. Egypt'),
    ('1.1. Cairo'),
    ('1.1.21. New Cairo'),
    ('1.1.21.5. Alexandria')
    -- SELECT STUFF('abcdef', 2, 3, 'ijklmn');
    SELECT
    CityName, RenumberedCityName=
    LTRIM(STUFF(REVERSE(SUBSTRING(SUBSTRING(REVERSE(CityName), CHARINDEX('.', REVERSE(CityName),1)+1,LEN(CityName))+'.',
    CHARINDEX('.',SUBSTRING(REVERSE(CityName), CHARINDEX('.', REVERSE(CityName),1)+1,LEN(CityName))+'.'),len(CityName))),1,1,'')+SPACE(1)+
    REVERSE(LTRIM(RTRIM(LEFT (REVERSE(CityName), CHARINDEX('.', REVERSE(CityName),1)-1)))))
    FROM @City WHERE CHARINDEX('.',CityName) > 0;
    CityName RenumberedCityName
    1. Egypt Egypt
    1.1. Cairo 1. Cairo
    1.1.21. New Cairo 1.1. New Cairo
    1.1.21.5. Alexandria 1.1.21. Alexandria
    -- USING hierarchyid method
    SELECT
    CityName, RenumberedCityName=
    LTRIM(REPLACE(STUFF(CONVERT(hierarchyid,'/'+REPLACE(LEFT(CityName, CHARINDEX(' ', CityName)-1),'.','/')).GetAncestor(1).ToString(),1,1,''),'/','.')
    +SPACE(1)+REVERSE(LTRIM(RTRIM(LEFT (REVERSE(CityName), CHARINDEX('.', REVERSE(CityName),1)-1)))))
    FROM @City WHERE CHARINDEX('.',CityName) > 0;
    CityName RenumberedCityName
    1. Egypt Egypt
    1.1. Cairo 1. Cairo
    1.1.21. New Cairo 1.1. New Cairo
    1.1.21.5. Alexandria 1.1.21. Alexandria
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Remove last 3 char ..

    Hi ,
         I need to remove last 3 char from my varible which is char 30.
    For example : WERKS = 1000 and .
    I need to remove last 3 char (and) from the above varibale .Kindly guide this
    Regards,
    VC

    Hi veerachamy,
    Just copy this code..it will work fine even if the field changes dynamically..
    I took w_char as 30 char..u can give ur field name there...
    data:
    w_char(30) type c value 'asdfghjklpoiu',
    w_tmp(30) type c,
    w_tmp1 type i.
    w_tmp1 = strlen( w_char ).
    w_tmp1 = w_tmp1 - 3.
    w_tmp = w_char+0(w_tmp1).
    write: w_tmp.
    Hope it resolves the issue...
    Regards
    Kiran

  • Removing of digital signature

    how to remove a digital signature from a document

    hi
    tks for your reply would appreciate if you could inform me the email address of the Acrobat forum if you have
    With Best Regards
    PARAG 

  • How to replace or remove last 500 bytes of a file without rewriting all the file?

    Hi everyone,
    Usually I only ask for help when I can't find a solution for several days or weeks... And guess what? That just happen!
    So, this is what i am trying to do:
    I have a program to ZIP folder and protect them with password, then it encrypts the zip file.
    That it's working fine, until the user forgets his password.
    So, what I want to do is give the user a Recovery Password option for each ZIP file created. I can't use the Windows Registry because the idea is to be able to recover the password in any computer.So i came up with an idea...
    In simple terms, this will work like this:
    0 - Choose folder to ZIP
    1 - Ask user for recover details (date of birth, email etc)
    2 - ZIP folder with password
    3 - Encrypt ZIP file
    4 - Encrypt recover details and convert it to HEX
    5 - Add recover details (in HEX) to the end of the ZIP file (last bytes)
    6 - Add "5265636F76657244657461696C73" which is the text "RecoverDetails" in HEX
    7 - Add "504B0506000000000000000000000000000000000000" this is the final bytes of a ZIP file and will make the Operating System think that is a ZIP file (i know that will give an error when we try to open it.. the ideia is to change the
    extension later and use my software to do all the work to access this ZIP/folder again)
    So, explaining what it's here, I want to say that I managed how to do all of this so far. The point number 6 will help us to determine where the recover details are in the file, or if they actually exist because user can choose not to use them.
    In order to unlock this ZIP and extract it's contents, I need to reverse what I've done. That means, that  need to read only the last 500 bytes (or less if the file is smaller) of the ZIP and remove those extra bytes I added so the program can check
    if the user is inputing a correct password, and if so decrypt contents and extract them.
    But, if the user insert a wrong password I need to re-add those bytes with the recover details again to the ZIP file.
    The second thing is, if the user forgets his password and asks to recover it, a form will be shown asking to insert the recover detail (date of birth, email etc), so we need to reed the last 500 bytes of the ZIP, find the bytes in number 6 and remove the
    bytes before number 6, remove bytes in number 6 and number 7, and we will have the recover details to match against the user details input.
    I have all done so far with the locking process. But i need help with the unlocking.
    I am not sure if it's possible, but this what i am looking for:
    Read last 500 bytes of a file, remove the bytes with recover details and save the file. Without reading the whole file, because if we have a 1GB file that will take a very long time. Also, i don't want to "waste" hard drive space creating a new
    clone file with 1GB and then delete the original.
    And then add them back "in case user fails the password" which should be exactly the same.
    This sounds a bit confusing I know, even to me, I am writing and trying to explain this the better I can.. Also my English is not the best..
    Here it goes some code to better understanding:
    'READ LAST 500 BYTES OF ZIP FILE TO CHECK IF IT CONTAINS RECOVER DETAILS
    Dim oFileStream As New FileStream(TextBox_ZIP_to_Protect.Text & ".zip", FileMode.Open, FileAccess.Read)
    Dim oBinaryReader As New BinaryReader(oFileStream)
    Dim lBytes As Long = oFileStream.Length
    oBinaryReader.BaseStream.Position = lBytes - 500
    Dim fileData As Byte() = oBinaryReader.ReadBytes(500)
    oBinaryReader.Close()
    oFileStream.Close()
    Dim txtTemp As New System.Text.StringBuilder()
    For Each myByte As Byte In fileData
    txtTemp.Append(myByte.ToString("X2"))
    Next
    Dim RecoveryDetailsPass_Holder = txtTemp.ToString()
    'Dim Temp_2 = txtTemp.ToString()
    'RichTextBox1.Text = txtTemp.ToString()
    If txtTemp.ToString.Contains("505245434F47414653") Then
    'we have password recovery details(the numbers mean RecoverDetails in HEX)
    'next we will get rid of everything before and after of string "cut_at"
    Dim mystr As String = RecoveryDetailsPass_Holder 'RichTextBox1.Text
    Dim cut_at As String = "505245434F47414653"
    Dim x As Integer = InStr(mystr, cut_at)
    ' Dim string_before As String = mystr.Substring(0, x - 1)
    Dim string_after As String = mystr.Substring(x + cut_at.Length - 1)
    RecoveryDetailsPass_Holder = RecoveryDetailsPass_Holder.Replace(string_after.ToString, "")
    RecoveryDetailsPass_Holder = RecoveryDetailsPass_Holder.Replace("505245434F47414653", "") ' this is RecoverDetails in HEX
    RecoveryDetailsPass_Holder = RecoveryDetailsPass_Holder.Replace("504B0506000000000000000000000000000000000000", "") ' this is the bytes of an empty zip file
    'AT THIS POINT WE HAVE ONLY THE RECOVER PASSWORD DETAILS (date of birth, email etc) IN THE VARIABLE "RecoveryDetailsPass_Holder"
    '////////////////////////////////////////////////////// TO DEBUG
    'MsgBox(string_after.ToString & "505245434F47414653")
    'InputBox("", "", string_after.ToString)
    '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ TO DEBUG
    'Temp_2 = Temp_2.Replace(RecoveryDetailsPass_Holder.ToString, "")
    Now that we have the recover details, we need to remove them from ZIP in order to the software try to unzip it with the password provided by the user on the GUI.
    If the user needs to recover the password we have the details already in RecoveryDetailsPass_Holder variable and just need to match them against user input details.
    If the user fails, we need to put the RecoveryDetailsPass_Holder back on the file.
    Any question just ask, it's a bit trick to explain i think, but please ask.
    Anyone know how to do this?
    Many thanks in advanced.
    Nothing is impossible!
    @ Portugal
    Vote if it's helpfull :)

    @ ALL
    Thank you very much for you help. I know that if I'm "playing" with bytes you should assume that I know a lot of VB.net, but I don't know that much unfortunately. I am not a beginner but I am still very fresh and I probably do stuff that work but
    probably not in the best way...
    Anyway, I will explain the idea of this little software I'm making. Once I wanted to create a program to protect folders with password, and I came up with something to change folder permissions to lock access to them, and that actually worked fine and quickly.
    However, I managed how to "crack" the protection by going to folder properties, security tab and then give permissions back to my username. So that, to me, wasn't a safer system to protect folders, also I want the ability to use passwords. So I search
    and search online for a way to do it, and someone replied (to someone with the same question as me) that the best option would be to create a zip with all contents of the folder, with password and then change the extension from .zip to .whatever and register
    the new extension .whatever on the Windows Registry, so that file will have an icon and open with my software.
    So I did...The program zips everything, change the extension and I added the encryption to avoid people changing the extension to ZIP or trying to open with 7-Zip or similar and be able to see the protected files names in the .zip/.whatever
    Answering to all of you now:
    @Armi
    "System.IO.FileStream.SetLength"
    I know I tried that but I erased the code because it didn't work for some reason, I don't remember why sorry, was long time before I created this post.
    The last code I was trying to use was this:
    ' Set the stream position to the desired location of the stream.
    Dim fileStream As IO.FileStream = _
    New IO.FileStream(TextBox_ZIP_to_Protect.Text & ".zip", IO.FileMode.Append)
    Try
    ' Set the stream (OFFSET) position to the desired location of the stream.
    fileStream.Seek(210, IO.SeekOrigin.Current)
    Dim Bytes_do_ZE As Byte() = HexStringToByteArray(Temp_2.ToString)
    'Write Characters ASCII
    For Each Byte_Do_Zeca As Byte In Bytes_do_ZE
    fileStream.WriteByte(Byte_Do_Zeca)
    Next
    Finally
    fileStream.Close()
    End Try
    and we need this:
    Private Shared Function HexStringToByteArray(ByRef strInput As String) As Byte()
    Dim length As Integer
    Dim bOutput As Byte()
    Dim c(1) As Integer
    length = strInput.Length / 2
    ReDim bOutput(length - 1)
    For i As Integer = 0 To (length - 1)
    For j As Integer = 0 To 1
    c(j) = Asc(strInput.Chars(i * 2 + j))
    If ((c(j) >= Asc("0")) And (c(j) <= Asc("9"))) Then
    c(j) = c(j) - Asc("0")
    ElseIf ((c(j) >= Asc("A")) And (c(j) <= Asc("F"))) Then
    c(j) = c(j) - Asc("A") + &HA
    ElseIf ((c(j) >= Asc("a")) And (c(j) <= Asc("f"))) Then
    c(j) = c(j) - Asc("a") + &HA
    End If
    Next j
    bOutput(i) = (c(0) * &H10 + c(1))
    Next i
    Return (bOutput)
    End Function
    That code, as I understand, is to search for the OFFSET of the bytes in the file and start to write from there... That OFFSET should be the beginning of the 500 bytes read on the code before. I got the OFFSET position "210" reading the file with
    the HEX editor "HxD - Hexeditor v1.7.7.0" but using the OFFSET won't work because every file, password, recover details and so on, are different and so the file size, changing the OFFSET I
    think.
    @Reed Kimble
    Does that sound like something which might work for you?
    Thanks for your help. That might be some solution, however it seams a bit of the same problem where we need to read the bytes again to get the recover details. But, as I said in this post, because this is meant to password protect folders, do you think that
    will apply as well?
    @Crazypennie
    Thanks for your reply.
    All this appears really weak. The user has your application since he need it to open the file .... and the code in the application contain the code to read the file without knowing the password. Therefore anyone can read your code and retrieve the
    data without the password ... if he knows VB.
    The application can only open the file if the user didn't use a password to protect the file. Because the file is encrypted and needs to be unencrypted first.
    When the application tries to open/read the file, will need to decrypt it first and then check for a password and do the validation. Also the application is with the code masked/protected which i think it might not be easy for reverse engineering.
    - You need to use a web server and a symmetric key encryption
    This a good idea, besides I don't know how to implement it. However the idea is to be able to:
    1 - Protect a folder anywhere in any Windows computer (portable app)
    2 - Recover password details (security question) in any computer, online and offline
    And I think we need a computer always connected to the Internet to use that method, right?
    @ Mr. Monkeyboy
    Thank you very much for your effort.
    I just wanted to let you know that the zip method you are using is no longer supported.
    I didn't actually knew that. Thanks for letting me know.
    Do you require the compressed encrypted files to actually be Zip files or could they just be compressed files that have nothing to do with Zip?
    No, it doesn't need to be a .zip extension. I am actually using my own extension. It starts as a Zip but then I changed to my own extension which I have registered on the Windows Registry.
    @ ALL
    Thanks again to all for trying and spending time helping me.
    By the way, I might not be able to answer or try any code during the weekend... It's easter break and family is around. Have a nice easter everyone. :)
    Nothing is impossible! Imagination is the limit!

  • How do I remove the digital signature option on Adobe Acrobat 7.x? I don't want it, but it pops up every time I need to sign a form, and I cannot find a way to remove

    I created a digital signature to sign forms using Adobe Acrobat 7.x. I really don't want or need this feature, but do not know how to remove it or keep it from popping up every time I need to sign a form. Can anyone help? I'm not that technically savvy, so please explain in layman's terms. Thanks!

    It's not clear to me what you're trying to accomplish. If you get rid of your digital ID you will still be prompted to create/add one when you need to sign a form, which you say you still need to do? Do you really just want to e-sign (hand-drawn signature, or stamp) instead of digitally sign? Do the forms you're using have digital signature fields?

  • Need to remove LAST NAME only in merged letter

    Here's my quandry. Client supplied a mail list with full name in column one. It's okay for the addressing portion, but in the salutation she wants to remove just the last name. I already merged my 2900 name list.
    So I have:
    Mary and John Smith
    123 Main St.
    Your Town, State Zip
    Dear Mary and John Smith,
    Then body of letter.
    I would need a way to search for any space and word before the comma and return in this one line only. Remove the space and last name so the comma slides over after John. I don't want to strip out any other words before a comma. I checked and I believe no line in the letter has a hard return following a comma.
    Doable? If so, how?

    Or you could search for \s[\l\u|\-]+(,)$ and replace with $1 to remove the last name and leave the comma next to the last word in the first name. this must be done as a find/change rather than a GREP style.
    Colin's method is nice in it can be a style, but it leaves "space" between the last visible name and the comma because the text is still present. Colin "escaped" the comma in his version, too, but is seems to make no difference in my test.

  • FCP5 removes last frame from any 23.98fps movie

    I'm having an issue with 23.98fps Quicktimes in FCP. When I play the clip in Quicktime, the frame count is correct. When the same movie is opened in the FCP viewer or dropped in a bin, FCP removes the last frame. For example, say I have 2 clips, identical in every way except for frame rate:
    Clip A - 720p Photo-JPEG 120 frames 24fps
    Clip B - 720p Photo-JPEG 120 frames 23.98fps
    In QT7, both clips play correctly, contain all frames, and are reported in the info window to be 5 seconds exactly. In FCP Clip A, plays correctly, contains all frames, and has a reported length of 00:00:05:00. Clip B is missing the last frame and has a reported length of 00:00:04:23.
    I have done this same test with a 480 frame clip as well with the same results. QT7 reports 20 seconds, FCP reports 00:00:19:23.
    I have had this problem with quicktime movies from different sources as well, not just QT movies I have created. It is imperative that I find out what is causing this issue. If anyone can offer any suggestions/answers at all, it would be much appreciated.
    PowerMac Dual G5   Mac OS X (10.4)  

    hello anthony.
    i can't offer any explanation, but i can offer what might be a work around. i am assuming you need to work at 23.98 and that you are receiving exact frame count files.
    if you receive files @ 24fps which are correct, try using cinema tools to "conform" these files to 23.98 ... just open the file from within cinema tools and hit the conform button. i'd be interested to know if these conformed files maintain the correct frame count.
    a guess might be that the export or transcode process might be the source of the error.
    R.

  • How to remove last char in a string by space

    I have to implement backspace application(remove a last char in a string , when we pressed a button).
    for ex: I enter the no
    1234
    instead of 1236
    So when i press a button on the JWindow... it should display
    123
    so that i can enter 6 now.
    I tried to display the string "123 " instead over "1234" but it is not working when the no background is specified. but works fine when a background color is specified.
    The string is displayed as
    Graphics2D g = (Graphics2D)window.getGraphics();
    AttributedString as = new AttributedString(string, map);
    g.drawString(as.getIterator(),x,y);
    In the map, the background is set to NO_BACKGROUND.
    Thanks and regards

    Deja vu. I saw this kind of post before, and I'm sure
    it was today.http://forum.java.sun.com/thread.jspa?threadID=588110&tstart=0
    Here it is.

  • Removing Last Word in Columns in Numbers '09

    I've got a column full of names. Some names are multiple words, like, "Bob & Nancy Smith", while others are 2 words, first and last name. I just want to remove the final word, the last name, in each cell. Formulas I've found on this forum only apply if there are 2 words. Can you help me??
    Message was edited by: phillipsler

    EDIT: I took "remove" as meaning you wanted the last name, not that you wanted the last name gone. Rereading your post I think I got that backwards.
    I can think of a brute force method which requires a few columns. You can reduce it to fewer columns by combining formulas together. Or maybe someone else has a more elegant approach
    Column B = the names
    Column C = 0 (zero)
    Column D =IFERROR(FIND(" ",$B,C+1),"")
    Drag-fill or copy/paste D into columns E-J
    K2 =COUNT(D2:J2) drag-fill to the rest of the column
    Column L =OFFSET(C,0,K)
    Column M =RIGHT(B,LEN(B)-L)
    Columns D through J locate all the spaces. K and L together find the position of the last space in the string. M returns everything to the right of that last space. You can combine K through M into one formula but I don't know of a more elegant way to find the last space than by finding each one, one at a time.
    There are, I'm sure, other ways than this to do the same basic thing but the ones I can think of also require multiple columns.
    Message was edited by: Badunit
    Message was edited by: Badunit

  • Removing last 2 characters from string field

    I am trying to remove the last 2 characters of a string field.
    there is no consistant length in the field
    316R1
    12364R1
    i want to remove everything after R
    i tried instrrev but i that didnt do it.
    is there a way to say
    start position1 and go the R
    thanks

    formula,
    left (field, length_formula) is the solution
    the length_formula is the number of chars form left
    f.i
    left(field, length (field)-2)
    left (field, InstrRev, field,"R")
    of course a combination with Right is also possible

  • Port forwarding to ip address only allows input of last digits

    I have the Linksys BEFW11S4 router and am trying to port forward to a static ip address but the port forwarding screen is hard coded to 192.168.1.__ and only allows me to enter the last 3 digits of the quartet. Does anyone know how I can get past this? I'm trying to connect a DVR server using this static ip address.

    If your ISP assigns you a static public IP address and you are required by your ISP to configure that on your router, then you have to configure the static IP, subnet mask, gateway IP and DNS servers in the internet connection section of the main setup page in the web interface of the router.
    You then assign a static local IP address like 192.168.1.25 to your DVR, subnet mask 255.255.255.0, gateway 192.168.1.1 and DNS 192.168.1.1 or the DNS servers of your ISP.
    You don't have to disable the DHCP server function in the router.

Maybe you are looking for

  • Schedule Lines deletion from Scheduling agreement

    Hello all There is a requirement of mass changes deletion of existing Schedlue lines from Schedling agreement ( from around 800 Scheduling agreement).  SAP  version is 4.7(Which doesnt have MEMASSSA-std t-code for mass maintenance of scheduling agree

  • Dedicating physical CPUs to a zone and migrating a Solaris 8 box to a zone?

    If I have a machine with a large number of cores (say 24), and dedicate 4 of the CPUs to the zone, psrinfo shows the number of CPU's dedicated to that zone as 4, however, the global zone still shows 24. Does this mean that if there's enough stuff run

  • Premier Pro CS5 with Adobe Audition 3.0

    I have two computers, one a desktop with XP Pro 32bit, the other a laptop with Windows 7 64bit. On the XP machine the Premier Pro menu allows me to edit the sound of a clip in either Soundbooth or Audition. On the Windows 7 PC I can only edit in Soun

  • Problem with camera bb9860

    Having issues with the image of my bb9860 camera, its seams to have some noice and the image its with stripes

  • Data folder not included with installer?

    For some reason this time I built installer, it didn't include data folder. Why would it do it and what does data folder do? Kind Regards Austin