Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Sed character number specification Post 302072895 by mvalonso on Monday 8th of May 2006 04:14:49 PM
Old 05-08-2006
Sed character number specification

I have the following sed command:

sed '/7361105/s/^\(................................................................................................. .............................................................................\)....\(.*\)/\16776\2/' arch.txt > arch.tmp && mv arch.tmp arch.txt

and I would like to replace the n "." (174 characters) in the first expression, to an expression that does the same (indicate that I want to replace from character number 175).
I've checked it out in manuals and tutorials but I can't seem to make it work.
Any ideas?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Number or Character

How to find that a given variable is a number or character? e.g. echo "Enter the number" read var If "$var" is a number then display "Number has been entered" else display "Character has been entered". Thanking you in advance (3 Replies)
Discussion started by: j1yant
3 Replies

2. UNIX for Dummies Questions & Answers

defining a variable as a number or character?

I am writing a script that needs to accept numbers into a variable by prompting and using the code read num case $num in 000) break ;; *) I am fairly new to unix and am loving the versatility of the language but need a little shove in the right... (1 Reply)
Discussion started by: noobian
1 Replies

3. UNIX for Dummies Questions & Answers

SED: Can't Repeat Search Character in SED Output

I'm not sure if the problem I'm seeing is an artifact of sed or simply a beginner's mistake. Here's the problem: I want to add a zero-width space following each underscore between XML tags. For example, if I had the following xml: <MY_BIG_TAG>This_is_a_test</MY_BIG_TAG> It should look like... (8 Replies)
Discussion started by: rhetoric101
8 Replies

4. Shell Programming and Scripting

check number of character

hi, I would like to calculate number of character for a number, for exemple : 1200 --> there are 4 characters , 120001 -> 5 characters (4 Replies)
Discussion started by: francis_tom
4 Replies

5. Shell Programming and Scripting

Count number of occurences of a character in a field defined by the character in another field

Hello, I have a text file with n lines in the following format (9 column fields): Example: contig00012 149606 G C 49 68 60 18 c$cccccacccccccccc^c I need to count the number of lower-case and upper-case occurences in column 9, respectively, of the... (3 Replies)
Discussion started by: s052866
3 Replies

6. Shell Programming and Scripting

In Sed how can I replace starting from the 7th character to the 15th character.

Hi All, Was wondering how I can do the following.... I have a String as follows "ACCTRL000005022RRWDKKEEDKDD...." This string can be in a file called tail.out or in a Variable called $VAR2 Now I have another variable called $VAR1="000004785" (9 bytes long), I need the content of... (5 Replies)
Discussion started by: mohullah
5 Replies

7. Shell Programming and Scripting

count and number instances of a character in sed or awk

I currently use LaTeX together with a sed script to set cloze test papers for my students. I currently pepend and equals sign to the front of the words I want to leave out in the finished test, =perpendicular, for example. I am able to number the blanks using a variable in LaTeX. I would like to... (8 Replies)
Discussion started by: maouinin
8 Replies

8. UNIX for Dummies Questions & Answers

Find certain number of character in vi

Hello, Experts, I have a file with the first and second column connected together, and i want to use vi to seperate them (put a space in between). Is there any command in vi would put a space after the 7th letter? Thanks! example: 0.981101.517 2.944101.517 4.907101.517 (10 Replies)
Discussion started by: wingsy1212
10 Replies

9. Shell Programming and Scripting

Sed: delete on each line before a character and after a character

Hi there, A total sed noob here. Is there a way using sed to delete everything before a character AND after another character on each line in a file? The deletion should also delete the indicating characters(here: an opening and a closing parenthesis). The original file would look like... (3 Replies)
Discussion started by: bnbsd
3 Replies

10. Shell Programming and Scripting

sed searches a character string for a specified delimiter character, and returns a leading or traili

Hi, Anyone can help using SED searches a character string for a specified delimiter character, and returns a leading or trailing space/blank. Text file : "1"|"ExternalClassDEA519CF5"|"Art1" "2"|"ExternalClass563EA516C"|"Art3" "3"|"ExternalClass305ED16B8"|"Art9" ... ... ... (2 Replies)
Discussion started by: fspalero
2 Replies
DPKG-CHECKDEPS.RB(1)					      General Commands Manual					      DPKG-CHECKDEPS.RB(1)

NAME
dpkg-checkdeps.rb - Utility to check deb dependency SYNOPSIS
dpkg-checkdeps.rb [opts] debfile ... dpkg-checkdeps.rb [opts] --from packages pkgname... dpkg-checkdeps.rb [opts] --from --all dpkg-checkdeps.rb [opts] --check pkgname... opts: --to packages --arch arch --verbose -q DESCRIPTION
dpkg-checkdeps.rb checks deb dependency problems when specified deb packages are installed in the target packages list. OPTIONS
-t packages-file --to packages-file Specify target packages-file. If this option is used multiple times, packages lists are appended. If no -t option specified, default is current installed packages list, that is, /var/lib/dpkg/status. -f packages-file --from packages-file Specify source packages-file. If this option is used multiple times, packages lists are appended. If you use this option, you can select packages by package-name, or all of them by --all option. -A --all Select all packages in source packages-file. You must use this option with --from option. -a arch --arch arch Specify acceptable arch in packages-file. Default is installation_architecture of dpkg. -c --check Check selected packages are satisfied by all packages in target packages. -v --verbose Verbose mode -h --help Display some help. EXAMPLES
% dpkg-checkdeps.rb --arch alpha --to '*/binary-$ARCH/Packages' --from ../proposed-updates/Packages' --all % dpkg-checkdeps.rb --to '*/binary-$ARCH/Packages' --check libc6 BUGS
There are probably tons of bugs in this program. This checks only depends, recommends and suggests, doesn't check pre-depends and conflicts, yet. This program comes with no warranties. If running this program causes fire and brimstone to rain down upon the earth, you will be on our own. AUTHOR
Fumitoshi UKAI <ukai@debian.or.jp>. DEBIAN
Debian Utilities DPKG-CHECKDEPS.RB(1)
All times are GMT -4. The time now is 02:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy