Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Effects of grep -o when it's not available Post 302269435 by rubin on Wednesday 17th of December 2008 05:08:45 PM
Old 12-17-2008
Quote:
Originally Posted by earnstaf
Edit: I used your code on a single record and it worked like a charm. Is there any way I can get that same output on multiple records?
Edit2: Disregard the below... I kept your RS=' ' the same and ran the code on an entire 400 record file, and it did output different variables for each record, but with no formatting. I need it to give a newline at the end of each individual record. Ideas?
...
It's unclear ( at least for me ) what's your expected output. Do you need the output as a formatted file, or as only variables set ( no formatting needed ) ?

Are there more extracts than the six ones that you needed before ? If that's the case they need to be explicitly entered into the previous code.

In your previous post you were looking to set extracts as variables; the point here is that if you have the same extracts over many records, their values as variables will be overwritten in the final output ( say, in record 1 -> name=AAA, in record 2 -> name=BBB,... ), so in the end you'll have only ONE variable
set ( say last record 400 -> name=ZZZ ). In case you need all of them, the variable names will have to have different ( say sequential ) names ( example name1, name2,...,name400), to access them separately. There cannot be two variables with the same name.

Quote:
Originally Posted by earnstaf
For whatever reason, I couldnt even pipe the output of the awk to something else (sed). Can someone tell me why that is? I imagine it has something to do with how the variables are handled by the eval command.

Simply remove eval to make the output of the command available to a pipe + other command. Eval will really evaluate ( execute ) the buried value of a statement, it can be a variable or command, so when the pipe comes, it's too late, the variables are already set and no more std input for the pipe.

Can you post about 10 lines of your input, your final expected output, and some more info regarding my above points ?
 

6 More Discussions You Might Find Interesting

1. Cybersecurity

Effects on data size during encrypted transfer

Hi There, I wonder if any one can help me. I want to transfer a file from one site to another over an encrypted link. I want to know if there will be any imcrease in the data that will travel on the link? For example, I want to transfer a 1 GB file from one site to another, using an encrypted... (4 Replies)
Discussion started by: ahmerin
4 Replies

2. Red Hat

3D effects on RHEL6 OC

Hello, I just installed RHEL6 OC on my T61p. It's great! Just for fun I'd like to use some fancy cool Desktop effects. I tried to enable 3D Desktop effects from OC Welcome Center but it gave me error message: Accelerated 3D graphics is not available. Desktop effects require hardware 3D support.... (7 Replies)
Discussion started by: susja
7 Replies

3. Red Hat

3d effects in rhel6

I installed rhel 6.0 in my laptop but it is not upporting 3d graphics of rhel6 and i am getting an error message "Accelerated 3d graphics not available Desktop effects require hardware 3D support." my laptop is dll studio 1558 and my graphic card is ATI Radeon 5470 with 1 gb dedicated ram. (6 Replies)
Discussion started by: nileshgupta
6 Replies

4. Red Hat

Effects of /etc/fstab file!

Hi Folks! I accidentally overwrote in /etc/fstab file. Can you guys please tell me, what impact it would have created, when I restarted the machine(RHEL6). I executed this command : # blkid /dev/vda5 > /etc/fstab (17 Replies)
Discussion started by: nixhead
17 Replies

5. Ubuntu

Ubuntu encryption and its effects

How will Full Disk encryption effect how open-source software is compiled and run using ubuntu 14.04. Are there alternatives that are recommended? Thank you :). (0 Replies)
Discussion started by: cmccabe
0 Replies

6. What is on Your Mind?

Remove filter effects from downloaded videos?

Does anyone know a way to remove filter effects from videos downloaded from YouTube or elsewhere, preferably with software that runs in Windows 7? Thank you in anticipation. (1 Reply)
Discussion started by: quadphonic
1 Replies
RLAM(1) 						      General Commands Manual							   RLAM(1)

NAME
rlam - laminate records from multiple files SYNOPSIS
rlam [ -tS ][ -u ][ -iaN | -ifN | -idN | -iiN | -iwN | -ibN ] input1 input2 .. DESCRIPTION
Rlam simply joins records (or lines) from multiple inputs, separating them with the given string (TAB by default). Different separators may be given for different files by specifying additional -t options in between each file name. Note that there is no space between this option and its argument. If none of the input files uses an ASCII separator, then no end-of-line character will be printed, either. An input is either a stream or a command. Commands are given in quotes, and begin with an exclamantion point ('!'). If the inputs do not have the same number of lines, then shorter files will stop contributing to the output as they run out. The -ia option may be used to specify ASCII input (the default), or the -if option may be used to indicated binary IEEE 32-bit floats on input. Similarly, the -id and -ii options may be used to indicate binary 64-bit doubles or integer words, respectively. The -iw option specifies 2-byte short words, and the -ib option specifies bytes. If a number is immediately follows any of these options, then it indi- cates that multiple such values are expected for each record. For example, -if3 indicates three floats per input record for the next named input. In the case of the -ia option, no number indicates one line per input record, and numbers greater than zero indicate that many characters exactly per record. For binary input formts, no number implies one value per record. For anything other than EOL-separated input, the default tab separator is reset to the empty string. A hyphen ('-') by itself can be used to indicate the standard input, and may appear multiple times. The -u option forces output after each record (i.e., one run through inputs). EXAMPLE
To join files output1 and output2, separated by a comma: rlam -t, output1 output2 To join a file with line numbers (starting at 0) and its reverse: cnt `wc -l < lam.c` | rlam - -t: lam.c -t '!tail -r lam.c' To join four data files, each having three doubles per record: rlam -id3 file1.dbl file2.dbl file3.dbl file4.dbl > combined.dbl AUTHOR
Greg Ward SEE ALSO
cnt(1), histo(1), neaten(1), rcalc(1), tabfunc(1), total(1) RADIANCE
7/8/97 RLAM(1)
All times are GMT -4. The time now is 09:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy