I have a file, say files_list, as below (o/p of ls -R cmd)
I want to read this file in a loop and produce an o/p like
I was able to extract all sub-dir in a file, say sub_dir_file
I thought of looping through the list of sub-dir and using below sed between
Am I on the right path or can you please correct the sed /from/,/to pattern/p command?
Good Day,
Im new to scripting especially awk and sed. I just would like to ask help from you guys about a sed command that prints the line immediately after a regexp, but not the line containing the regexp.
sed -n '/regexp/{n;p;}' filename
What if my regexp is 3 word or a sentence. Im... (3 Replies)
Hi,
I would like to know how to solve one of my problems using expert unix commands.
I have a file with occasional blank lines;
for example;
dertu
frthu
fghtu
frtty
frtgy
frgtui
frgtu
ghrye
frhutp
frjuf
I need to edit the file so that the file looks like this; (10 Replies)
I am on a Solaris 10 x86 system
sample code
before3
before2
before1
group
after1
after2
after3
I want to grab the second line above my regexp
regexp=group
I want to grab ONLY the before2 line
I have numerous sed and awk ways of grabbing X line below the regexp, but no luck... (1 Reply)
Dear all,
I'm a new guy in Linux scripting. Basically, I have no idea on how to write a script.
Now, I have a problem in preparing my gaussian inputs.
For example, I have a file like this
File name: input.gjf
H 1.418400 1.180500 -1.247900
H -1.894500 1.628800 -0.000200
Product
H... (7 Replies)
Hi all,
This should be very easy but I can't figure it out...
I have a file that looks like this:
@SRR057408.1 FW8Y5CK02R652T length=34
AGCAGTGGTATCAACGCAGAGTAAGCAGTGGTAT
+SRR057408.1 FW8Y5CK02R652T length=34
FIIHFF6666?=:88@@@BBD:::?@ABBAAA>8
@SRR057408.2 FW8Y5CK02TBMHV length=52... (1 Reply)
All I want is to look for the pattern in the file...If I found it at # places... I want print lines after those pattern(line) until I find a blank line.
Log EXAMPLE :
MT:Exception caught
The following Numbers were affected:
1234
2345
2346
Error
java.lang.InternalError:... (3 Replies)
Hi All
I'm trying to extract the line just above a regexp and all lines after this.
I'm currently doing this in two steps
sed -n -e "/^+---/{g;p;}" -e h oldfile.txt > modified.txt
sed -e "1,/^+---/d" -e "/^$/d" oldfile.txt >>modified.txt
Sample
sometext will be here
sometext will be... (3 Replies)
Dear all
I want to search special string in file and then print next all line in one line until blank lines come. Help me plz for same. My input file and desire op file is as under.
i/p file:
A1/EXT "BSCABD1_21233G1" 757 130823 1157
RADIO X-CEIVER ADMINISTRATION
BTS EXTERNAL FAULT
... (7 Replies)
I'm looking for a way to print the 4th line back from a regular expression. Kind of like the below but it has to be the 4th line before the regexp.
Print the line immediately before regexp, but not the line containing the regexp.
sed -n '/regexp/{g;1!p;};h'
here is an example of logs(i... (11 Replies)
Hi All,
I need to print the characters in the previous line just before the regular expression match
Please have a look at the input file as attached
I need to match the regular expression ^ with the character of the previous like and also the pin numbers
and the output file should be like... (6 Replies)