10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
In the awk piped to sed below I am trying to format file by removing the odd xxxx_digits and whitespace after, then move the even xxxx_digit to the line above it and add a space between them. There may be multiple lines in file but they are in the same format. The Filename_ID line is the last line... (4 Replies)
Discussion started by: cmccabe
2. Shell Programming and Scripting
In the awk below, what I am attempting to do is check each line in the tab-delimeted input, which has ~20 lines in it, for a keyword
SVTYPE=Fusion. If the keyword is found I am splitting $3 using the . (dot) and reading the portion before and after the dot in an array a.
If it does have that... (12 Replies)
Discussion started by: cmccabe
3. Shell Programming and Scripting
I am trying to combine lines with these conditions:
1. First line starts with text of "libname VALUE db2 datasrc" where VALUE can be any text.
2. If condition1 is met then continue to combine lines through a line that ends with a semicolon.
3. Ignore case when matching patterns and remove any... (5 Replies)
Discussion started by: Wes Kem
4. Shell Programming and Scripting
Oracle Linux 6.4/Bash
I have a file like below. I want to remove all lines which start with # character. Can I do this vi editor ? If not , which other utility can I use for this ?
# This is a test script
CUSER=`id |cut -d"(" -f2 | cut -d ")" -f1`
# Some text
CDATE=`date +%y%m%d` ## get... (3 Replies)
Discussion started by: kraljic
5. Shell Programming and Scripting
Hi All ,
I have a file with below data
# User@Host: xyz @
# Query_time: t1 Lock_time: t2 Rows_sent: n1 Rows_examined: n2
select count(1) from table;
# Time: 140406 23:30:01
# User@Host: abc @
# Query_time: t1 Lock_time: t2 Rows_sent: n1 Rows_examined:... (6 Replies)
Discussion started by: rakesh_411
6. Shell Programming and Scripting
Hi, I have multiple large files which consist of the below format:
I am trying to write an awk or sed script to remove all occurrences of the 00 record except the first and remove all of the 80 records except the last one.
Any help would be greatly appreciated. (10 Replies)
Discussion started by: nwalsh88
7. Shell Programming and Scripting
I can't decide if I should use AWK or PERL after pouring over these forums for hours today I decided I'd post something and see if I couldn't get some advice.
I've got a text file full of hundreds of events in this format:
Record Number : 1
Records in Seq : ... (3 Replies)
Discussion started by: Mayday22
8. Shell Programming and Scripting
Is it possible to remove empty lines between >humid-sets (bold) and also humidset that start with -- (for ex: > humid3 | () : | (+) )
Thanx in advance
Note: The humid sets will be in thousands and lines will be more than 100 thousand.
> humid1 | () : | (+)... (7 Replies)
Discussion started by: quincyjones
9. Shell Programming and Scripting
This is related to one of my previous post but now with a slight difference: I need the "Updated:" to be in one line as well as the "Information:" on one line as well. These are in multiple lines right now as seen below. These can have 2 or more lines that needs to be in one line.
System name:... (8 Replies)
Discussion started by: The One
10. Shell Programming and Scripting
I keep having to remove lines have an IP address as the second field from my awstats logs, as it makes the processing fail.
Rather than do it individually each time (once or twice a week) it fails, I'd like to remove any lines from the file that have 3 digits and then a dot as the start... (1 Reply)
Discussion started by: sfisk