Sponsored Content
Top Forums Shell Programming and Scripting Extract substring specif position and length from file line Post 302781141 by Yoda on Friday 15th of March 2013 03:34:28 PM
Old 03-15-2013
No offence taken. It is my bad that I really didn't consider scenarios like backslash escaping & globbing. I really appreciate your feedback.

Thank you! Smilie
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to extract a substring froma file

hi all, I'm really newbie on this and I need some help. how is the best way to extract a strig or substring from a each line in a file. e.g. I want to print only this ERROR=JUD+the followed numbers from one line like this one, considering the numbers change related to different errors ... (1 Reply)
Discussion started by: morena
1 Replies

2. Shell Programming and Scripting

Deleting Characters at specific position in a line if the line is certain length

I've got a file that would have lines similar to: 12345678 x.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 23456781 x.00 xx.00 xx.00 xx.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 34567812 x.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 45678123 x.00 xx.00 xx.00 xx.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 xx.00... (10 Replies)
Discussion started by: Cailet
10 Replies

3. UNIX for Dummies Questions & Answers

Extract substring of unknown length from string

I have a string: hgLogOutput=" +0000 files: forum/web/hook-test.txt /forum/web/hook-test-2.txt description: test" and I want to extract the file names from it, they will always appear between the files: and the description:. I have worked out that I can do this: "$hgLogOutput" | awk '{... (2 Replies)
Discussion started by: klogger
2 Replies

4. UNIX for Dummies Questions & Answers

Using sed to extract a substring at end of line

This is the line that I am using: sed 's/^*\({3}*$\)/\1 /' <test.txt >results.txt and suppose that test.txt contains the following lines: http://www.example.com/200904/AUS.txt http://www.example.com/200903/_RUS.txt http://www.example.com/200902/.FRA.txt What I expected to see in results.txt... (6 Replies)
Discussion started by: figaro
6 Replies

5. UNIX for Dummies Questions & Answers

To Extract words from File based on Position

Hi Guys, While I was writing one shell script , I just got struck at this point. I need to extract words from a file at some specified position and do some comparison operation and need to replace the extracted word with another word. Eg : I like Orange very much. I need to replace... (19 Replies)
Discussion started by: kuttu123
19 Replies

6. Shell Programming and Scripting

Add substring in a file containing fixed length record.

I am new to awk and writing a script using awk. I have file containing fixed length records, I wish to extract 2 substring(each substring is padded with zeros on left e.g 000000003623) and add each substring respectively for every record in the file to get total sum of respective substring for all... (5 Replies)
Discussion started by: Devesh5683
5 Replies

7. UNIX for Dummies Questions & Answers

Help with awk, where line length and field position are variable

I have several questions about using awk. I'm hoping someone could lend me a hand. (I'm also hoping that my questions make sense.) I have a file that contains pipe separated data. Each line has similar data but the number of fields and the field position on each line is variable. ... (3 Replies)
Discussion started by: Cheese64
3 Replies

8. Shell Programming and Scripting

Extract substring in a file

Hello, A question please. A have a file that contains a string. Ex: AAAABBCCCCCDDEEEEEEEEEEFF I'd want to recover 2 substrings, 'BB' and 'FF' and then leave them in a new file. Could anoyone help me please? Thanks in advance (3 Replies)
Discussion started by: nolo41
3 Replies

9. Shell Programming and Scripting

Extract a substring from a file

Hello, A question please. A have a file that contains a string. Ex: AAAABBCCCCCDDEEEEEEEEEEFF I'd want to recover 2 substrings, 'BB' and 'FF' and then leave them in a new file. From position 5, 2 caracters (ex:"BB") and from position 25, 2 caracters (ex:"FF") in a file. Could anoyone help me... (3 Replies)
Discussion started by: nolo41
3 Replies
feedback(1)						      General Commands Manual						       feedback(1)

NAME
feedback - Generate an optimization feedback file using pixie and prof SYNOPSIS
feedback [prof-options] [-o feedback-file] [-v] objfile [objfile-arguments] OPTIONS
The feedback command accepts the following prof(1) options and any unambiguous abbreviations: -asm, -clock megahertz, -{e|E}xclude proce- dure_name, -feedback filename, -heavy, -invocations, -lines, -merge filename, -numbers, -{o|O}nly procedure_name, -procedures, -quit n, -testcoverage, -truecycles [0,1,2], -zero. The feedback command ignores all other options in order to provide compatiblility with older versions of the feedback command. An option argument following an option not recognized by this or older versions of the feedback command will be treated as the objfile argument. Specifies the name of the feedback file. This can also be specified by the -feedback option of prof. You should use only one of these options to specify a feedback file, not both. Causes the pixie, application, and prof commands to be printed as they are invoked. OPERANDS
Specifies the executable of the application for which a feedback file is to be generated. A pixie-instrumented version of this executable will be executed with the current working directory and environment variables. The feedback file that is generated will reflect the behav- ior of one execution of the instrumented objfile. Specify the arguments that will cause the behavior that you want to have optimized when the compiler uses the feedback file. DESCRIPTION
The feedback command invokes pixie to add profiling code to an object file. The object file generated by pixie is executed to obtain pro- filing information. The feedback command then invokes prof to analyze the profiling information. If the output of objfile needs to be redirected, but not the output of the feedback utility, the redirection characters need to have sh(1) syntax and be within quotes. If objfile is multi-threaded, the LD_LIBRARY_PATH environment variable needs to include the current working directory. EXAMPLES
Send the profiling information to the standard output: $ feedback myprog Write a binary formatted performance profile to the file myprog.feedback, which then helps a subsequent recompilation optimize the program: $ feedback -feedback myprog.feedback myprog $ cc -O -feedback myprog.feedback -o myprog myprog.c FILES
Object with profiling code. Generated by pixie. Basic block addresses. Generated by pixie. Basic block counts. Generated by myprog.pixie. Note: Run pixie and prof independently if alternative names are needed. SEE ALSO
cc(1), pixie(5), prof(1) feedback(1)
All times are GMT -4. The time now is 12:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy