Sponsored Content
Top Forums Shell Programming and Scripting sed remove last 10 characters of a line start from 3rd line Post 302178933 by era on Wednesday 26th of March 2008 03:34:34 PM
Old 03-26-2008
Last 10? or start from? Proper grammar would help here.

Remove last ten characters on all lines from the third through the end:

Code:
sed '3,$s/..........$//'

Coping with lines with fewer than ten characters left as a desperate follow-up question with incomplete sentences and weird terminology. You're welcome.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SED help (remove line::parse again::add line)

Aloha! I have just over 1k of users that have permissions that they shouldn't under our system. I need to parse a provided list of usernames, check their permissions file, and strip the permissions that they are not allowed to have. If upon the permissions strip they are left with no permissions,... (6 Replies)
Discussion started by: Malumake
6 Replies

2. Shell Programming and Scripting

sed to remove 1st two characters every line of text file

what is the sed command to remove the first two characters of every line of a text file? each line of the text file has the same amount of characters, and they are ALL NUMERIC. there are hundreds of lines though. for example, >cat file1.txt 10081551 10081599 10082234 10082259 20081134... (20 Replies)
Discussion started by: ajp7701
20 Replies

3. UNIX for Dummies Questions & Answers

remove characters from line

Hello, I have multiple lines in a file, each of which will have data that looks like this: xxxxxyyyyzzzz4abcdXYZXYZXYZ pqrstPQRST2cdPQRSTPQRST lmnopqr6abcdefgRST.3abc I want to be able to remove the number 4 + the following 4 characters (abcd) in the first line. For the second line,... (1 Reply)
Discussion started by: Gussifinknottle
1 Replies

4. Shell Programming and Scripting

How to remove special characters from each line?

Hello, Is there a simpler way to remove special characters (color codes) from each lines in a log file? I use sed like in the example below but I think there should be a more simple way to achieve the same result: $ cat -vet file1 ^, , , , Maybe to convert the file somehow? ... (5 Replies)
Discussion started by: majormark
5 Replies

5. UNIX for Dummies Questions & Answers

Sed to remove only first line erroneously removes last line too

Hello everyone, This is my first posting. I have read the rules of this forum. I have searched many various threads and haven't found one that applies to my situation or suggestions to fix the issue. I do appreciate the help. I am trying to execute a basic UNIX script in a Solaris... (4 Replies)
Discussion started by: dqrgk0
4 Replies

6. UNIX Desktop Questions & Answers

Remove new line characters from a file

I tried using below command tr -cd "" < InputFile.xml > output.txt ============= This removes all the tabs/newline/extra spaces from a file it successfully removed all the extra spaces,tabs and new line characters but then the complete file become one record. I want to retain one new line... (1 Reply)
Discussion started by: saini
1 Replies

7. Shell Programming and Scripting

remove first few characters from each line

Hi, I have a file with lines like below. I need to remove first few characters from each line until a date format is found. 05/06/12 20:47:02 GUMGUY@98.192.174.74{42B42A72AC955F5926621273E3A15059.tomcat2}TP-Processor15 LogExchUsage: ERROR: 05/06/12 20:47:02... (8 Replies)
Discussion started by: ratheeshjulk
8 Replies

8. Shell Programming and Scripting

Remove characters from line

I have a the following line 22.152.25.36 - K##### "GET /DGGKE/GetMail.do;jwebsphere=FADFFFGSFGSFGSDGFSDFGSDFGSDF HTTP/1.1" 200 44948 Need a cut command which should give me the below output 22.152.25.36 - K##### "GET /DGGKE/GetMail.do HTTP/1.1" 200 44948 Note: The value of jwebsphere can... (6 Replies)
Discussion started by: suindar1982
6 Replies

9. Shell Programming and Scripting

Ksh: Read line parse characters into variable and remove the line if the date is older than 50 days

I have a test file with the following format, It contains the username_date when the user was locked from the database. $ cat lockedusers.txt TEST1_21062016 TEST2_02122015 TEST3_01032016 TEST4_01042016 I'm writing a ksh script and faced with this difficult scenario for my... (11 Replies)
Discussion started by: humble_learner
11 Replies

10. Shell Programming and Scripting

How to remove part of the line from start of the line?

Hello, I am java command from a shell script which will generate the below output on the command prompt signature Base64 :... (10 Replies)
Discussion started by: chetanojha
10 Replies
PCK(5)							Standards, Environments, and Macros						    PCK(5)

NAME
PCK, pck - map between PCK and character set DESCRIPTION
PCK stands for PC Kanji code. It is also known as Shift-JIS (MS kanji) code. This manual page shows map between PCK and character set. PCK allocates the first byte of each kanji code which corresponds to JIS X0208-1990 and so on to the code other than code range of 0x00-0x7f and 0xa1-0xdf. The following is a map table for PCK and character set. +-----------------------------------------------------------+ |PCK character set | |0x00 - 0x19 JIS X 0201-1976 function | | character set | |0x20 JIS X 0201-1976 space char- | | acter | |0x21 - 0x7e JIS X 0201-1976 figure | | character set for roman | | character | |0x7f JIS X 0201-1976 erase char- | | acter | |0xa1 - 0xdf JIS X 0201-1976 figure | | character set for katakana | | (except for an area of | | undefined character E/0 - | | F/14) | |0x8140 - 0x817e JIS X 0208-1990 (1 ku 1 | | ten - 1 ku 63 ten) | |0x8180 - 0x819e JIS X 0208-1990 (1 ku 64 | | ten - 1 ku 94 ten) | |0x819f - 0x81fc JIS X 0208-1990 (2 ku 1 | | ten - 2 ku 94 ten) | | : : | | : : | |0x9f9f - 0x9ffc JIS X 0208-1990 (62 ku 1 | | ten - 62 ku 94 ten) | |0xe040 - 0xe07e JIS X 0208-1990 (63 ku 1 | | ten - 63 ku 63 ten) | | : : | | : : | |0xea40 - 0xea7e JIS X 0208-1990 (83 ku 1 | | ten - 83 ku 63 ten) | |0xea80 - 0xea9e JIS X 0208-1990 (83 ku 64 | | ten - 83 ku 94 ten) | |0xea9f - 0xeafc JIS X 0208-1990 (84 ku 1 | | ten - 84 ku 94 ten) | +-----------------------------------------------------------+ The differences from character set of Japanese EUC are, o Character set of Japanese EUC codeset 3 (JIS X 0212-1990) is not assigned except a part of Vender Defined Character (IBM extension character) (see NOTES). o Character set which corresponds to Japanese EUC C1 control code is not assigned. NOTES
In PCK area below has special meaning. +---------------------------------------------------------------------------+ |PCK area of character set meaning | |0x8740 - 0x879e JIS X 0208-1990 13 ku Vender Defined Character | | (special symbols) | |0xeb40 - 0xecfc Invalid | |0xed40 - 0xeffc Vender Defined Character | | (IBM extension character NEC | | selected) | |0xf040 - 0xf9fc User Defined Character | | 1 ku - 20 ku | |0xfa40 - 0xfcfc Vender Defined Character | | (IBM extension character) | +---------------------------------------------------------------------------+ SEE ALSO
eucJP(5) SunOS 5.10 6 Jan 1999 PCK(5)
All times are GMT -4. The time now is 02:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy