Effects of grep -o when it's not available


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Effects of grep -o when it's not available
# 8  
Old 12-17-2008
So, I ended up making it work by taking the huge string that the awk command output, pasting it into word and then doing a search and replace (replace name=* with \nname= ") However, I hate relying on a M$ product if I dont have to, so I'd love to hear some suggestions on how to make this happen on my Unix box.

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.
# 9  
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 ?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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
Login or Register to Ask a Question