Sponsored Content
Full Discussion: Delete specific characters
Operating Systems AIX Delete specific characters Post 302187330 by rubin on Sunday 20th of April 2008 09:10:05 PM
Old 04-20-2008
Quote:
Originally Posted by masquerer

... to check if the number is starting from 0 and then delete the 0 without doing anything else!!!!

Removing only the first 0:

Code:
awk '{sub(/^0/,"")}1' list

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

tell me how many specific characters there are?

i'm trying to get the user to enter a character, then the script should search for how many of that character exists in the file. I have the following code, but it doesn't work properly and it shows the wrong amount (i don't think im supposed to use grep). For example, I want it to say, "There are... (7 Replies)
Discussion started by: kev269
7 Replies

2. Shell Programming and Scripting

How to delete characters using a file

Hi All, I have a configuration file (file.cfg) in which data will be like this ; , _ + a to z A to Z Now i have to read a textfile (file.txt) and i need to check whether there is any other character present in text file that is not existing in (file.cfg). If other characters are present... (4 Replies)
Discussion started by: krishna_gnv
4 Replies

3. Shell Programming and Scripting

need to Delete first 10 characters of a file name

Hello Everyone, I need help in deleting first 10 characters from the filename in a directory eg: 1234567890samplefile1.txt 1234567890samplefile2.txt and so on.. need to get the output as samplefile1.txt Thanks in Advance!!!! (8 Replies)
Discussion started by: Olivia
8 Replies

4. Shell Programming and Scripting

delete first 2 characters for each line, please help

hi, ./R1_970330_210505.sard ./R1_970403_223412.sard ./R1_970626_115235.sard ./R1_970626_214344.sard ./R1_970716_234214.sard ... ... ... for these strings, i wanna remove the ./ for each line how can i do that? i know it could possibly be done by sed, but i really have not idea how... (4 Replies)
Discussion started by: sunnydanniel
4 Replies

5. Shell Programming and Scripting

sed replacing specific characters and control characters by escaping

sed -e "s// /g" old.txt > new.txt While I do know some control characters need to be escaped, can normal characters also be escaped and still work the same way? Basically I do not know all control characters that have a special meaning, for example, ?, ., % have a meaning and have to be escaped... (11 Replies)
Discussion started by: ijustneeda
11 Replies

6. Shell Programming and Scripting

How delete characters of specific line with sed?

Hi, I have a text file with some lines like this: /MEDIA/DISK1/23568742.MOV /MEDIA/DISK1/87456321.AVI /MEDIA/DISK2/PART1/45753131.AVI /IMPORT/44452.WAV ... I want to remove the last 12 characters in each line that it ends "AVI". Should look like this: /MEDIA/DISK1/23568742.MOV... (12 Replies)
Discussion started by: inaki
12 Replies

7. Shell Programming and Scripting

Can't figure out how to find specific characters in specific columns

I am trying to find a specific set of characters in a long file. I only want to find the characters in column 265 for 4 bytes. Is there a search for that? I tried cut but couldn't get it to work. Ex. I want to find '9999' in column 265 for 4 bytes. If it is in there, I want it to print... (12 Replies)
Discussion started by: Drenhead
12 Replies

8. Shell Programming and Scripting

Count specific characters at specific column positions

Hi all, I need help. I have an input text file (input.txt) like this: 21 GTGCAACACCGTCTTGAGAGG 50 21 GACCGAGACAGAATGAAAATC 73 21 CGGGTCTGTAGTAGCAAACGC 108 21 CGAAAAATGAACCCCTTTATC 220 21 CGTGATCCTGTTGAAGGGTCG 259 Now I need to count A/T/G/C numbers at each character location in column... (2 Replies)
Discussion started by: thienxho
2 Replies

9. Shell Programming and Scripting

Delete and retain some characters

Ive been trying to google and tried sed and awk. BUt still getting no exact formula. I would like to know how to parse this at: From: Compute Machin Appliance 3.2.9.10000 123456 To: Compute Machin Appliance 3.2.9.123456 (5 Replies)
Discussion started by: kenshinhimura
5 Replies

10. Shell Programming and Scripting

Count specific character of a file in each line and delete this character in a specific position

I will appreciate if you help me here in this script in Solaris Enviroment. Scenario: i have 2 files : 1) /tmp/TRANSACTIONS_DAILY_20180730.txt: 201807300000000004 201807300000000005 201807300000000006 201807300000000007 201807300000000008 2)... (10 Replies)
Discussion started by: teokon90
10 Replies
CLOUDSERVERS(1) 						   User Commands						   CLOUDSERVERS(1)

NAME
cloudservers - Command-line interface to the Cloud Servers API. SYNOPSIS
cloudservers [ --username USERNAME ] [ --apikey APIKEY ] <subcommand> DESCRIPTION
cloudservers is a command line interface to the Rackspace Cloud Servers API. COMMAND OVERVIEW
cloudservers backup-schedule Show or edit the backup schedule for a server. cloudservers backup-schedule-delete Delete the backup schedule for a server. cloudservers boot Boot a new server. cloudservers delete Immediately shut down and delete a server. cloudservers flavor-list Print a list of available 'flavors' (sizes of servers). cloudservers help Display help about this program or one of its subcommands. cloudservers image-create Create a new image by taking a snapshot of a running server. cloudservers image-delete Delete an image. cloudservers image-list Print a list of available images to boot from. cloudservers ip-share Share an IP address from the given IP group onto a server. cloudservers ip-unshare Stop sharing an given address with a server. cloudservers ipgroup-create Create a new IP group. cloudservers ipgroup-delete Delete an IP group. cloudservers ipgroup-list Show IP groups. cloudservers ipgroup-show Show details about a particular IP group. cloudservers list List active servers. cloudservers reboot Reboot a server. cloudservers rebuild Shutdown, re-image, and re-boot a server. cloudservers rename Rename a server. cloudservers resize Resize a server. cloudservers resize-confirm Confirm a previous resize. cloudservers resize-revert Revert a previous resize (and return to the previous VM). cloudservers root-password Change the root password for a server. cloudservers show Show details about the given server. Optional arguments: --username USERNAME Defaults to env[CLOUD_SERVERS_USERNAME]. --apikey APIKEY Defaults to env[CLOUD_SERVERS_API_KEY]. See "cloudservers help COMMAND" for help on a specific command. cloudservers March 2010 CLOUDSERVERS(1)
All times are GMT -4. The time now is 03:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy