Sponsored Content
Top Forums Shell Programming and Scripting Reading selected lines from a param file Post 302624135 by sam05121988 on Monday 16th of April 2012 12:06:37 AM
Old 04-16-2012
If your param file is hardcoded, I mean if you always have the values on 2nd, 4th and 6th line you can use

1. If you want to keep the quotes
Code:
 sed -ne '2 p' -e '4 p' -e '6 p' paramfilename

2. If quotes are not required
Code:
  sed -ne 's/"//g' -e '2 p' -e '4 p' -e '6 p' paramfilename

about visibility of the file i am not sure what exactly you are trying to say...
you can set permission as 711 i.e. rwx--x--x

Code:
 chmod 711 paramfilename

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script for reading filelist and preparing param file.

Hi All, Not sure if this would be in a dummies sectiin or advanced. I'm looking for a script if someone has doen something like this. I have list of files - adc_earnedpoints.20070630.txt adc_earnedpoints.20070707.txt adc_earnedpoints.20070714.txt adc_earnedpoints.20070721.txt... (2 Replies)
Discussion started by: thebeginer
2 Replies

2. UNIX for Advanced & Expert Users

Reading a file and writing the file name to a param file.

Hi All, Not sure if this would be in a dummies sectiin or advanced. I'm looking for a script if someone has doen something like this. I have list of files - adc_earnedpoints.20070630.txt adc_earnedpoints.20070707.txt adc_earnedpoints.20070714.txt adc_earnedpoints.20070721.txt... (1 Reply)
Discussion started by: thebeginer
1 Replies

3. Shell Programming and Scripting

trying to print selected fields of selected lines by AWK

I am trying to print 1st, 2nd, 13th and 14th fields of a file of line numbers from 29 to 10029. I dont know how to put this in one code. Currently I am removing the selected lines by awk 'NR==29,NR==10029' File1 > File2 and then doing awk '{print $1, $2, $13, $14}' File2 > File3 Can... (3 Replies)
Discussion started by: ananyob
3 Replies

4. Shell Programming and Scripting

skip lines while reading a file

Hi Experts, I am tryin to read a file and while doing so i need to skip the lines which start with a hash (#) char. I thought of using a goto command but a lot of guys on this site say its not the good way to program. Moreover I am using a ksh shell which deos not support goto command. ... (4 Replies)
Discussion started by: bankimmehta
4 Replies

5. Shell Programming and Scripting

Print selected lines from file in order

I need to extract selected lines from a log file, I can use grep to pull one line matching 'x' or matching 'y', how can I run through the log printing both matching lines in order top to bottom. i.e line 1 xyz - not needed line 2 User01 - needed line 3 123 - not needed line 4 Info - needed... (2 Replies)
Discussion started by: rosslm
2 Replies

6. Shell Programming and Scripting

Regarding reading lines into a new file

Hi all, I jut use a loop to read lines from the user and redirect it to a file. echo "Enter the line" while read -r LINE do echo $LINE >> FILE if ;then break fi done input app... (1 Reply)
Discussion started by: Ananthdoss
1 Replies

7. Shell Programming and Scripting

Selected lines from a file based on another file

Hello, I am using Awk in Ubuntu 12.04 First file: I have a file like this: SNP1 1 198.2 SNP2 1 124.5 SNP3 1 124.4 . . . Second file: I have another file like this: SNP2 SNP5 SNP10 . . . I want to create a third file like my first file but keeping ONLY the SNPs that... (8 Replies)
Discussion started by: Homa
8 Replies

8. Shell Programming and Scripting

Reading in two lines at once from a text file

Hello everyone, I have thought about this for quite some time and know what I want to do but am having some trouble at it. I have a text file filled with numbers like this, there are more in the file obviously. Each number is separated by a space. 1 3 2 4 5 1 -1 1 0 -1 5The idea is... (7 Replies)
Discussion started by: tastybrownies
7 Replies

9. Shell Programming and Scripting

Deleting selected lines in a file

Hi Guys , I have two files say a1 and a2 having following contents a1 dag wfd a2 dag wfd chire hcm I want to delete only the lines in a2 which are in a1 and final output of a2 should be a2 chire hcm (6 Replies)
Discussion started by: Pradeep_1990
6 Replies

10. UNIX for Beginners Questions & Answers

Reading and copying a selected rows

Dear All, I have a data file input.res like below. (Only six column shown here for example.) Sequence of first column starting from 1 to 148. Input file 1 Q0 9_August_2014_Entertainment2 0 20.14967806339729 BM25b1.0 1 Q0 13_October_2012_Page323 1 20.134224346765738 BM25b1.0 1 Q0... (2 Replies)
Discussion started by: imranrasheedamu
2 Replies
mlib_SignaluLaw2ALaw(3MLIB)				    mediaLib Library Functions				       mlib_SignaluLaw2ALaw(3MLIB)

NAME
mlib_SignaluLaw2ALaw - ITU G.711 m-law and A-law compression and decompression SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_SignaluLaw2ALaw(mlib_u8 *acode, const mlib_u8 *ucode, mlib_s32 n); DESCRIPTION
The mlib_SignaluLaw2ALaw() function performs ITU G.711 m-law and A-law compression and decompression in compliance with the ITU (formerly CCITT) G.711 specification. PARAMETERS
The function takes the following arguments: acode A-law code array. ucode m-law code array. n Number of samples in the input array. RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_SignalALaw2Linear(3MLIB), mlib_SignalALaw2uLaw(3MLIB), mlib_SignalLinear2ALaw(3MLIB), mlib_SignalLinear2uLaw(3MLIB), mlib_Signalu- Law2Linear(3MLIB), attributes(5) SunOS 5.10 9 Nov 2004 mlib_SignaluLaw2ALaw(3MLIB)
All times are GMT -4. The time now is 02:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy