Still new to bash. Using debian lenny 5, bash version 3.2.39. I'm working on three scripts. I need help completing them.
One script that inputs a plain text file, echo then chop it up into separate whitespace-delimited strings as an output. Not sure how to do this...
for example, the content could be this:
Second script that inputs a plain text file and output is stripped of uuid's (all versions) and ip addresses for example
I would guess with the exception of [0-9A-Z] with awk?
also not sure how to do this.
Third script that input a plain text file and output the unique lines, sorted according to their frequency
code so far:
---------- Post updated at 11:39 PM ---------- Previous update was at 04:02 PM ----------
Ok so I got two scripts done. I actually just need help on the second script.
Last edited by l20N1N; 09-01-2010 at 10:40 PM..
Reason: correction
Thanks! It worked! If you don't mind, I have one more question. I need to use a similar sed command to filter out this kind of data:
I can modify the one you provided right? For instance
I know
is the first 8 digits including letters,
is the next 8 digits with the dashes, and
is the last 12 characters; correct? so the code would be something like
?
Thanks! It worked! If you don't mind, I have one more question. I need to use a similar sed command to filter out this kind of data:
I can modify the one you provided right? For instance
I know
is the first 8 digits including letters,
is the next 8 digits with the dashes,
Hi, not exactly.
means a sequence of 4 or more hexadecimale digits ( a-f being lowercase ) followed by a dash.
means the sequence in escaped parentheses( "\(" and "\)" ) is repeated 4 times in its entirety.
So combing these two, 4 hexadecimal numbers followed by dashes of minimally 4 hexadecimal characters...
Quote:
and
is the last 12 characters; correct?
Correct. the g of course means there can be multiple occurrences of the entire match per line.
Quote:
so the code would be something like
?
Yes, that would match it. You could lose the comma if the first part is always exactly 10 digits, and also you do not need the escaped parentheses.
Last edited by Scrutinizer; 09-02-2010 at 08:43 PM..
This User Gave Thanks to Scrutinizer For This Post:
I need to filter a file that is composed like that:
>Cluster 0
0 292nt, >last294258;size=1;... *
>Cluster 1
0 292nt, >last111510;size=1;... *
1 290nt, >last136280;size=1;... at -/98.62%
2 292nt, >last217336;size=1;... at +/99.66%
3 292nt, >last280937;size=1;... at -/99.32%
>Cluster 2... (6 Replies)
Hello,
I extracted a list of files in a directory with the command ls . However this is not my computer, so the ls functionality has been revamped so that it gives the filesizes in front like this :
This is the output of ls command : I stored the output in a file filelist
1.1M... (5 Replies)
We are trying to scp files from machine A to machine B. We want to copy the files in the rate using the file original timestamps. Sometimes files have the same time stamp. So we want to start scp for all files with the same time stamp at the same time.
I like to get some opinion on using... (0 Replies)
Hi how can I filter the text using this one.
SAMPLE
servervmpool -listall|tail -11
================================================================================
pool number: 112
pool name: Net-Ora-1wk
description: Net-Ora-1wk
max partially full: 0... (12 Replies)
I want to remove everything from a file but the word following the search word.
Example:
crap crap crap crap SearchWord WordToKeep crap crap crap
How would I do this with say awk or grep?
Thank you! (4 Replies)
I'm trying to write a script which prints out the users who are loged in.
Printing the output of the "users" command isn't the problem. What I want is to filter out my own username.
users | grep -v (username)
does not work because the whole line in which username exists is suppressed.
If... (5 Replies)