Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Removing characters from end of string Post 302633123 by jyoung on Tuesday 1st of May 2012 11:19:24 AM
Old 05-01-2012
Removing characters from end of string

Hello,
I have records like below that I want to remove any five characters from the end of the string before the double quotes unless it is only an asterik.
Code:
    3919,5020                  ,04/17/2012,0000000000006601.43,,0000000000000000.00,,       132,        251219,"*"
1668,0125                  ,04/16/2012,0000000000001720.00,,0000000000000000.00,,       124,        232287,"04/09-13/12 IT CONTRACT CONSULTANT SVCS RENDERED           kkl20"

I don't care what the characters are, but I need to retain the double quotes after I remove them. Can you point me to some examples of how to accomplish this? Thank you.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Removing characters from end of $string

I am writing a script to search PCL output and append more PCL data to the end accordingly. I need to remove the last 88 bytes from the string. I have searched for a few hours now and am coming up with nothing. I can't use head or tail because the PCL output is all on one line. awk crashes on... (3 Replies)
Discussion started by: craig2k
3 Replies

2. Shell Programming and Scripting

Removing characters from a string

I need help to strip out the first two characters of the variable $FileName. Please help. FileName=`find . -mtime +0 -name '*'` Contents of variable $FileName: ./SRIZVI4.MCR_IDEAS_REPORT.LAST.052705.075405.csv I want to strip out "./" and place the contents in another variable. How do I... (3 Replies)
Discussion started by: mh53j_fe
3 Replies

3. AIX

CUT command - cutting characters from end of string

Hello, I need to delete the final few characters from a parameter leaving just the first few. However, the characters which need to remain will not always be a string of the same length. For instance, the parameter will be passed as BN_HSBC_NTRS/hub_mth_ifce.sf. I only need the bit before the... (2 Replies)
Discussion started by: JWilliams
2 Replies

4. Shell Programming and Scripting

Removing characters from end of line (length unknown)

Hi I have a file which contains wrong XML, There are some garbage characters at the end of line that I want to get rid of. Example: <request type="product" ><attributes><pair><name>q</name><value><!]></value></pair><pair><name>start</name><value>1</value></pair></attributes></request>�J ... (7 Replies)
Discussion started by: dirtyd0ggy
7 Replies

5. Shell Programming and Scripting

Removing "^M" from the end of a String (i.e. "Ctrl+M")?

Hello All, I have an Expect script that ssh's to a remote server and runs some commands before exiting. One of the commands I run is the "hostname" Command. After I run this command I save the output using this line in the code below... Basically it executes the hostname command, then I... (2 Replies)
Discussion started by: mrm5102
2 Replies

6. Shell Programming and Scripting

Help Needed! - Cut characters after a text string and append to end of filename

Hi all.. I have several unique files that contain one thing in common, and that is acct#. For all files in the directory, I want to append the 10 characters following the word "ACCOUNT:" to the end of the filename. for example: I have file 111_123 that contains ACCOUNT:ABC1234567 The file... (5 Replies)
Discussion started by: cinderella1
5 Replies

7. 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

8. Shell Programming and Scripting

sed - Removing all characters from token to end of line

Hello. The token is any printable characters between 2 " . The token is unknown, but we know that it is between 2 " Tok 1 : "1234x567" Tok 2 : "A3b6+None" Tok 3 : "A3b6!1234=@" The ligne is : Line 1 : "9876xABCDE"Do you have any code fragments or data samples in your post Line 2 : ... (3 Replies)
Discussion started by: jcdole
3 Replies

9. Shell Programming and Scripting

Grep a particular string from column eliminating characters at the end.

Hi, So basically I have this file containing query output in seperated columns. In particular column I have the below strings: news news-prio I am trying to grep the string news without listing news-prio aswell. I tried grep "$MSG_TYPE" , grep -w "$MSG_TYPE" , grep... (4 Replies)
Discussion started by: nms
4 Replies

10. Shell Programming and Scripting

Outputting characters after a given string and reporting the characters in the row below --sed

I have this fastq file: @M04961:22:000000000-B5VGJ:1:1101:9280:7106 1:N:0:86 GGGGGGGGGGGGCATGAAAACATACAAACCGTCTTTCCAGAAATTGTTCCAAGTATCGGCAACAGCTTTATCAATACCATGAAAAATATCAACCACACCA +test-1 GGGGGGGGGGGGGGGGGCCGGGGGFF,EDFFGEDFG,@DGGCGGEGGG7DCGGGF68CGFFFGGGG@CGDGFFDFEFEFF:30CGAFFDFEFF8CAF;;8... (10 Replies)
Discussion started by: Xterra
10 Replies
HCSECD.CONF(5)						      BSD File Formats Manual						    HCSECD.CONF(5)

NAME
hcsecd.conf -- hcsecd(8) configuration file DESCRIPTION
The hcsecd.conf file is the configuration file for the hcsecd(8) Bluetooth link keys/PIN codes management daemon. The hcsecd.conf file is a free-form ASCII text file. It is parsed by the recursive-descent parser built into hcsecd(8). The file may con- tain extra tabs and newlines for formatting purposes. Keywords in the file are case-sensitive. Comments may be placed anywhere within the file (except within quotes). Comments begin with the '#' character and end at the end of the line. FILE FORMAT
The hcsecd.conf file consists of a list of device entries. Each device entry defines a link key or PIN code for a remote Bluetooth device. Each remote Bluetooth device is identified by its unique BD_ADDR. The device entry device { option argument; [option argument;] } The following section describes all supported options and arguments. bdaddr BD_ADDR Specify remote device BD_ADDR for the entry. name device_name Specify user friendly name for the entry. Name is a string in straight double quotes. key link_key Specify link key for the entry. Link key is hexadecimal string up to 32 characters in length starting with '0x'. key nokey Specify no link key for the entry. pin PIN_code Specify PIN code for the entry. PIN code is a string up to 16 characters in length in straight double quotes. pin nopin Specify no PIN code for the entry. EXAMPLES
A sample hcsecd.conf file: # Default entry is applied if no better match found # It MUST have 00:00:00:00:00:00 as bdaddr device { bdaddr 00:00:00:00:00:00; name "Default entry"; key nokey; pin nopin; } # Ericsson T68 phone device { bdaddr 00:80:37:5e:4d:d4; name "Ericsson T68 phone"; key nokey; pin "0000"; # PIN code } # Dummy device device { bdaddr 00:11:22:33:44:55; name "Dummy"; key 0x00112233445566778899aabbccddeeff; # 16 bytes key pin nopin; } SEE ALSO
hcsecd(8) AUTHORS
Maksim Yevmenkin <m_evmenkin@yahoo.com> BSD
May 26, 2003 BSD
All times are GMT -4. The time now is 04:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy