Sponsored Content
Top Forums Shell Programming and Scripting Please help. Complicated text file manipulation problem Post 302558405 by tinman47 on Friday 23rd of September 2011 01:05:23 PM
Old 09-23-2011
For example, I want to open a text file, move to the 2nd row, 10th column in the file, and put the escape code "\n".
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Text file manipulation

Hi, I need to remove lines from a text file that are less than certain length in UNIX. For example, test.txt file contains the following lines: abcdefghijklmnopqrstuvwxyz. 123456789009876543211234567 This line to be removed. zyxwvutsrqponmlkjihgfedcba. The length of each line is supposed... (5 Replies)
Discussion started by: svannala
5 Replies

2. UNIX for Dummies Questions & Answers

Text file manipulation

I am a new unix user & I wanted to work with unix as it is very good in text manipulations. I need a little help. I will be grateful if someone can help me out. I need help in grepping a pattern of numbers from one file to another file. Specific details are as follows: File one contains only... (4 Replies)
Discussion started by: Ezy
4 Replies

3. Shell Programming and Scripting

Complicated(?) text file comparison

I've got two files, both plain text. Each file is a datafeed of products, pipe delimited. The current file is in directory 1 and yesterday's file is in directory 2 (literally, those are the directory names). What I'm trying to do is compare the files and pull out products whose price has changed... (3 Replies)
Discussion started by: Daniel M. Clark
3 Replies

4. Shell Programming and Scripting

File text manipulation

What I am trying to do is make a script that will add a port number within a section of a file if it already doesn't exist in that section of the file. The particular line that I would like to add the port number to in the file is formatted like this: TCPPORTS="25 80 125 443 8080 10000" For... (3 Replies)
Discussion started by: nullifx
3 Replies

5. Shell Programming and Scripting

Text File Manipulation

Hi, I need to write shell script for the scenario explained below - datafile.txt AcctNum,code,Region,,,, 12345451,AN ,abaab 12345452,AN ,xccxc 76677545,RP ,acxcc 43567878,RP ,afghh 32190900,AN ,afrfrf 87312345,AN ,aqaw I have a text file (datafile.txt)... (1 Reply)
Discussion started by: ravigupta2u
1 Replies

6. UNIX for Dummies Questions & Answers

Text File Manipulation Help

Hi I've two text files FILE_1 and FILE_2 as shown below: FILE_1.txt CO Contig1 342 12 11 U GGGCTGACGTGGCCGCTAATACGACTCACTATAGGG*AGAGAAGTCATTTTCTTGTTTAG BQ 35 35 35 50 50 50 50 50 50 50 50 60 65 65 65 65 65 65 65 65 65 65 65 65 50 AF GP5UOVN01AOPE0 U 1 AF GP5UOVN01AT8W3 U 1 ... (1 Reply)
Discussion started by: Fahmida
1 Replies

7. Shell Programming and Scripting

Difficult problem: Complex text file manipulation in bash script.

I don't know if this is a big issue or not, but I'm having difficulties. I apoligize for the upcoming essay :o. I'm writing a script, similar to a paint program that edits images, but in the form of ANSI block characters. The program so far is working. I managed to save the image into a file,... (14 Replies)
Discussion started by: tinman47
14 Replies

8. Programming

String Manipulation in a text file

Hi I have a requirement to write a script but not sure which is the best way to approach this I have not worked in sed but I'm aware that its robust for file extraction requirements I have a scripting task. I already developed the code in perl but the script is taking almost 2 mins for... (5 Replies)
Discussion started by: John Trevor
5 Replies

9. Shell Programming and Scripting

Text file manipulation

Hi Gurus, I have a question I have a flat file like below with three fields (3 rd field is amt) ad|B|500 cc||100 dd|C|600 ee||900 Need to write a code in such a way that when second field is empty then do sum of third field So in this case it will be 100 +900 I tried but no luck... (1 Reply)
Discussion started by: patricjemmy6
1 Replies

10. UNIX for Dummies Questions & Answers

Text File Manipulation

Hello, Supposing I had a huge list as follows: TAC manufacturer Device Type 1392600 LG D959 LG-D959TS FeaturePhone 1409700 LG V410 FeaturePhone 35150806 LG F350S FeaturePhone 35165206 Samsung GT-E1200 FeaturePhone 35194505 Nokia Asha 200 FeaturePhone but I want to make it look like... (3 Replies)
Discussion started by: Cludgie
3 Replies
PCOMB(1)						      General Commands Manual							  PCOMB(1)

NAME
       pcomb - combine RADIANCE pictures

SYNOPSIS
       pcomb [ -h ][ -w ][ -x xres ][ -y yres ][ -f file ][ -e expr ] [ [ -o ][ -s factor ][ -c r g b ] input ..  ]

DESCRIPTION
       Pcomb combines equal-sized RADIANCE pictures and sends the result to the standard output.  By default, the result is just a linear combina-
       tion of the input pictures multiplied by -s and -c coefficients, but an arbitrary mapping can be assigned with the -e and -f options.  Neg-
       ative coefficients and functions are allowed, and pcomb will produce color values of zero where they would be negative.

       The variables ro, go and bo specify the red, green and blue output values, respectively.  Alternatively, the single variable lo can be used
       to specify a brightness value for black and white output.  The predefined functions ri(n), gi(n) and bi(n) give the  red,  green  and  blue
       input  values  for picture n.  To access a pixel that is nearby the current one, these functions also accept optional x and y offsets.  For
       example, ri(3,-2,1) would return the red component of the pixel from picture 3 that is left 2 and up 1 from the current position.  Although
       x  offsets  may	be  as large as width of the picture, y offsets are limited to a small window (+/- 32 pixels) due to efficiency considera-
       tions.  However, it is not usually necessary to worry about this problem -- if the requested offset is not available, the next  best  pixel
       is returned instead.

       For  additional	convenience, the function li(n) is defined as the input brightness for picture n.  This function also accepts x and y off-
       sets.

       The constant nfiles gives the number of input files present, and WE gives the white efficacy (lumens/brightness) for  pixel  values,  which
       may  be	used  with the -o option or the le(n) values to convert to absolute photometric units (see below).  The variables x and y give the
       current output pixel location for use in spatially dependent functions, the constants xmax and ymax give the input resolution, and the con-
       stants  xres  and yres give the output resolution (usually the same, but see below).  The constant functions re(n), ge(n), be(n), and le(n)
       give the exposure values for picture n, and pa(n) gives the corresponding pixel aspect ratio.   Finally,  for  pictures	with  stored  view
       parameters,  the functions Ox(n), Oy(n) and Oz(n) return the ray origin in world coordinates for the current pixel in picture n, and Dx(n),
       Dy(n) and Dz(n) return the normalized ray direction.  In addition, the function T(n) returns the distance from the origin to the aft  clip-
       ping  plane  (or  zero  if there is no aft plane), and the function S(n) returns the solid angle of the current pixel in steradians (always
       zero for parallel views).  If the current pixel is outside the view region, T(n) will return a negative value, and S(n) will return zero.

       The -h option may be used to reduce the information header size, which can grow disproportionately after  multiple  runs  of  pcomb  and/or
       pcompos(1).   The  -w  option  can  be used to suppress warning messages about invalid calculations.  The -o option indicates that original
       pixel values are to be used for the next picture, undoing any previous exposure changes or color correction.

       The -x and -y options can be used to specify the desired output resolution, xres and yres, and can be expressions involving other constants
       such  as  xmax  and ymax.  The constants xres and yres may also be specified in a file or expression.  The default output resolution is the
       same as the input resolution.

       The -x and -y options must be present if there are no input files, when the definitions of ro, go and bo will be used to compute each  out-
       put  pixel.   This  is useful for producing simple test pictures for various purposes.  (Theoretically, one could write a complete renderer
       using just the functional language...)

       The standard input can be specified with a hyphen ('-').  A command that produces a RADIANCE picture can be given in place  of  a  file	by
       preceeding it with an exclamation point ('!').

EXAMPLES
       To produce a picture showing the difference between pic1 and pic2:

	 pcomb -e 'ro=ri(1)-ri(2);go=gi(1)-gi(2);bo=bi(1)-bi(2)' pic1 pic2 > diff

       Or, more efficiently:

	 pcomb pic1 -s -1 pic2 > diff

       To precompute the gamma correction for a picture:

	 pcomb -e 'ro=ri(1)^.4;go=gi(1)^.4;bo=bi(1)^.4' inp.hdr > gam.hdr

       To perform some special filtering:

	 pcomb -f myfilt.cal -x xmax/2 -y ymax/2 input.hdr > filtered.hdr

       To make a picture of a dot:

	 pcomb -x 100 -y 100 -e 'ro=b;go=b;bo=b;b=if((x-50)^2+(y-50)^2-25^2,0,1)' > dot

AUTHOR
       Greg Ward

SEE ALSO
       getinfo(1), icalc(1), pcompos(1), pfilt(1), rpict(1)

RADIANCE							      8/31/96								  PCOMB(1)
All times are GMT -4. The time now is 08:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy