I am currently working on a requirement in a file wher I have to filter the characters between two specific fields/patters and get the count of total no of characters between the two fields.
REQUIREMENT:
The below content is in a file
1. I have to get the no of characters between each instance starting with <test> and </test1> throughout the file.
2. With the no of characters obtained,
Find
No of tags which has more than 30 characters between them
No of tags which has less than 30 characters between t hem.
Ex:
I tried to perform this with sed command but I am unable to get an output.
Moderator's Comments:
Please use CODE tags as required by forum rules!
Last edited by RudiC; 01-31-2017 at 10:08 AM..
Reason: Added CODE tags.
HI,
I want to know can multiple pattern be given inside a sed statement..
Input:
aa_bb_cc.Mar-22-2007
cc_dd_ee.Mar-21-2007
aa_1002985_952.xml
aa_bb_032207.txt
aa_bb_cc_10002878.dat
Output:
aa_bb_cc
cc_dd_ee
aa.xml
aa_bb.txt
aa_bb_cc.dat (6 Replies)
Hi Gurus,
I have a file say for ex. file1 which has 3500 lines in it which are different account numbers and another file (file2) which has 230000 lines in it. I want to read all the lines in file1 and delete all those lines from file2 which has that same pattern as in file1. I am not quite... (4 Replies)
tar has the -T operand for reading patterns from a file.
Is there any way to read patterns from stdin, without creating a temp file? I would like to avoid iterating over the archive repeatedly (e.g. with a loop or xargs) as this is a large archive and we're only extracting a small number of... (2 Replies)
Hey, guys!
Trying to research this is such a pain since the read command itself is a common word. Try searching "unix OR linux read command examples" or using the command substitution keyword. :eek:
So, I wanted to use a command statement similar to the following.
This is kinda taken... (2 Replies)
hello
i have two files
temp.txt
and temp_unique.text
the second file consists the unique fields from the temp.txt file
the strings stored are in the following form
4,4
17,12
15,65
4,4
14,41
15,65
65,89
1254,1298i'm able to run the following script to get the total count of a... (3 Replies)
First, I apologize for my 'noobness' with Linux and the shell. I'm running Ubuntu with zsh as my shell.
What I'd like to be able to do is clean up a messy Downloads folder by moving categories of files to different directories with something like:
mv dir/$vids dest
mv dir/$music dest
mv... (5 Replies)
Hi,
I am facing issues with the below:
I have a lookup file say lookup.lkp.This lookup.lkp file contains strings delimited by comma(,).
Now i want to read this command from file and execute it.
So my code below is :
Contents in the lookup.lkp file is :
c_e,m,a,`cd $BOX | ls cef_*|tail... (7 Replies)
Hi,
I am trying to extract some patterns from a line. The input file is space delimited and i could not use column to get value after "IN" or "OUT" patterns as there could be multiple white spaces before the next digits that i need to print in the output file . I need to print 3 patterns in a... (3 Replies)
Hello.
For a given folder, I want to select any files find $PATH1 -f \( -name "*" but omit any files like pattern name ! -iname "*.jpg" ! -iname "*.xsession*" ..... \) and also omit any subfolder like pattern name -type d \( -name "/etc/gconf/gconf.*" -o -name "*cache*" -o -name "*Cache*" -o... (2 Replies)
Hi -
i have one file with content as below.
***** BEGIN 123 *****
BASH is awesome
***** END *****
***** BEGIN 365 *****
KSH is awesome
***** END *****
***** BEGIN 157 *****
KSH is awesome
***** END *****
***** BEGIN 7123 *****
C is awesome
***** END *****
I am trying to find all... (4 Replies)