Sponsored Content
Top Forums Shell Programming and Scripting Remove 3rd character from the end of a random-length string Post 302643459 by bartus11 on Saturday 19th of May 2012 01:23:09 PM
Old 05-19-2012
Code:
perl -pe 's/.(.{3})$/\1/' file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove box like special character from end of string

Hi All, How to remove a box like special character which appears at the end of a string/line/record. I have no clue what this box like special character is. It is transparent square like box. This appears in a .DAT file at the end of header. I'm to compare a value in header with a parameter.... (16 Replies)
Discussion started by: Qwerty123
16 Replies

2. Shell Programming and Scripting

How to remove a newline character at the end of filename

Hi All, I have named a file with current date,time and year as follows: month=`date | awk '{print $2}'` date=`date | awk '{print $3}'` year=`date | awk '{print $6}'` time=`date +%Hh_%Mm_%Ss'` filename="test_"$month"_"$date"_"$year"_"$time".txt" > $filename The file is created with a... (2 Replies)
Discussion started by: amio
2 Replies

3. Shell Programming and Scripting

Parsing 286 length Character string

Hi Friends, I have .txt file which has 13000 records. Each record is 278 character long. I am using below code to extract the string and it takes almost 10 minutes. Any suggestion please. cat filename.txt|while read line do f1=`echo $line|awk '{print substr($1,1,9)}'` f2=`echo... (6 Replies)
Discussion started by: ppat7046
6 Replies

4. Shell Programming and Scripting

Remove 3rd and onwards occurances of a character

I have a file with "@" in every line fdgfgddfg@sfsdfdsf@dfdfd@@vfdfsdfd@ sfsdfs@sdfd@gfhfgh@@ddffg@sdf@ srfgtfsdfs@sdfertrd@eergfhfgh@@ddffg@sdf@ wttrtrt@sdfd@sdfdf@@sdfdfds@@@ I need to remove all the fourth and onwards occurences of "@". so my final o/p would be fdgfgddfg@sfsdfdsf@dfdfd@... (7 Replies)
Discussion started by: Shivdatta
7 Replies

5. Shell Programming and Scripting

How to remove new line character at end of file.

I need to remove new line character from end of file. Suppose here are content. a|b|c|d|r a|b|c|d|r a|b|c|d|r <new line> that means file contains 4 lines but data is there in 3 lines. so I want that only 3 lines should be there in file. Please help (20 Replies)
Discussion started by: varun940
20 Replies

6. Shell Programming and Scripting

Remove lines between the start string and end string including start and end string Python

Hi, I am trying to remove lines once a string is found till another string is found including the start string and end string. I want to basically grab all the lines starting with color (closing bracket). PS: The line after the closing bracket for color could be anything (currently 'more').... (1 Reply)
Discussion started by: Dabheeruz
1 Replies

7. Shell Programming and Scripting

How to Remove comma as last character in end of last line of file?

how to Remove comma as last charector in end of last line of file: example: input file --------------- aaaaaa, bbbbbb, cccc, 12345, ____________ output file : ----------- aaaaaa, bbbbbb, (6 Replies)
Discussion started by: RahulJoshi
6 Replies

8. Shell Programming and Scripting

Generating a Random String of 'n' length

Hi, How can I generate a string of random characters (alpha+numeric) of a particular length ? For e.g. for n=5, output = 'kasjf' n=10, output = 'hedbcd902k' Also, please let me know if random (valid) dates could also be generated. Thanks (7 Replies)
Discussion started by: rishigc
7 Replies

9. Shell Programming and Scripting

Add string based on character length

Good day, I am a newbie here and thanks for accepting me I have a task to modify input data where my input data looks like 123|34567|CHINE 1|23|INDIA 34512|21|USA 104|901|INDIASee that my input has two columns with different character length but max length is 5 and minimum length is 0 which... (1 Reply)
Discussion started by: fastlearner
1 Replies

10. Shell Programming and Scripting

awk to print the string between 3rd and 4th backslashs to end of line

im trying to get awk to print the string between 3rd and 4th backslashs to end of line test could be any word this http://example.com/test/ >to this http://example.com/test/ > testalso the other way round insert string at end of line... (13 Replies)
Discussion started by: bob123
13 Replies
RKMAPROMA(3)						     Library Functions Manual						      RKMAPROMA(3)

NAME
RkMapRoma - perform Romaji-kana conversion by using a specified Romaji-kana conversion table SYNOPSIS
#include <canna/RK.h> int RkMapRoma(romaji, dst, maxdst, src, srclen, flags, status) struct RkRxDic *romaji; unsigned char *dst; int maxdst; unsigned char *src; int srclen; int flags; int *status; DESCRIPTION
RkMapRoma performs Romaji-kana conversion by using a specified Romaji-kana conversion table. romaji specifies a pointer to the Romaji-kana conversion table that has been returned by RkOpenRoma(3). RkMapRoma interprets the srclen bytes of contiguous data starting at the area src as a Romaji character string and searches through the Romaji-kana conversion table for the rule of Romaji-kana conversion that matches the beginning of the Romaji character string. If the corresponding conversion rule is found, the corresponding kana character string is stored in the area dst. The resulting character string is truncated when its byte length exceeds maxdst -1. dst is padded with null char- acters at the end if possible. flags is a combination of the following Romaji-kana conversion flags connected by or: RK_SOKUON Enables gemination, in which a sequence of two occurrences of the same character, xx, is converted to small kana character "tsu" only if it is not defined in the Romaji-kana conversion table file. RK_FLUSH Converts all Romaji characters compulsorily. Useful for handling n appearing at the end of a character string. The flags listed below specify the type of characters stored in src. These specified code conversion to be performed on the character string derived from the Romaji-kana conversion table. These flags can use one by one. RK_NFER No conversion RK_XFER Hiragana RK_HFER Single-byte character RK_KFER Katakana RK_ZFER Double-byte character status is set to the byte length of the character string set in the area dst. A negative value means that there is no matching Romaji character string. RETURN VALUE
This function returns the starting byte length of the Romaji character string matched by Romaji-kana conversion. RKMAPROMA(3)
All times are GMT -4. The time now is 02:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy