Please give us a CLEAR English explanation for the process that the script you want is supposed to use to transform your input into the output you want. And, please show us THE EXACT text in CODE tags for your desired sample output; not an image or a pointer to a webpage containing an image.
Your sample data shows five <app> values "bsi", "fap", "fsp", "unit", and "user" (in sorted order) and your sample output shows only two of those <app> values (in reverse sorted order, or input file order, or random order). How does this "sort a content of a text file"???
Your sample input has 20 lines. Your sample output has a total count of 565075???
If you won't show us the exact output you want from a 20 line input sample and won't give us a clear specification of what you're trying to do, any time that volunteers here devote to trying to help you is a waste of time. Please help us help you!
Last edited by Don Cragun; 12-08-2014 at 07:55 AM..
Reason: Explicitly state that we want to see exact sample output.
Here is the list of 59 entries which is the sample input. I need this list to be sorted as explained below.
These entries can be classified into the following.
10 entries of the type 'fap'
11 entries of the type 'NMDemo'
7 entries of the type 'NMTalent'
7 entries of the type 'unit'
7 entries of the type 'psf'
5 entries of the type 'sbl'
6 entries of the type 'jde'
6 unclassified entry (the last 6 in the list)
each entry of any type is followed by a numeric which represents its environment. eg : In psf0254-LROBERTS, psf is type and 0254 is the environment
two entries of a type may have the same environments. eg: jde0261-ACCTPAY & jde0261-ACCTREV are different entries but share the same environment 0261
Now, I would like to have the following input sorted and the output like below.
NOTE 1 : The 'count' column should the total number of entries under a particular type.
NOTE 2 : The 'env' column shows the number of unique environments in a type. eg : fap got 10 entries but 8 unique environments.
NOTE 3 : the 'unclassified' type does not have any environment associated and hence contains all the 'non-type' values
And what should be done with the entries:
you had in an earlier sample input? The "type" (formerly "app name") "user" and two "env" (formerly "number of env") "1" and "2" values are present, but there is no "-" or name entry.
Will all entries for a given type and environment be adjacent as they are in your input samples? If not, will all entries for a given type be adjacent as they are in your input samples?
You say that you want your output sorted, but the types shown in your sample output are not sorted; the output order is in the same order as your input. If the output is supposed to be sorted (other than having the header lines come first and the "unclassified" entry come last), what are the sort keys?
Your earlier posts said you wanted a total count at the end of the output; your last sample output does not show a total count. Which is correct?
This may come close to what you want, based on the sample in post #11. As I can't recognize any sort pattern in your sample output, I've left out that part, as well as the total count that disappeared somewhere down the road. Try
1. The problem statement, all variables and given/known data:
I have a file with a fragment of a novel, which I have to clear from punctuation and sort all the words contained one per line and non duplicated, all this going to a file called "palabras".
Here is fragment of the input file:
... (4 Replies)
Hi Guru's,
I am new to shell scripting. I have a unique requirement:
The system generates a single pdf(/tmp/ABC.pdf) file with Invoices for Multiple Customers, the format is something like this:
Page1 >> Customer 1 >>Invoice1 + invoice 2 >> Page1 end
Page2 >> Customer 2 >>Invoice 3 + Invoice 4... (3 Replies)
Hi
I am looking for a help in designing a bash script on linux which can do below:-
1) Look in a specific directory for any new files
2) Mail the content of the new file
Appreciate any help
Regards
Neha (5 Replies)
Hello everyone,
I work under Ubuntu 11.10 (c-shell)
I need a script to create a new text file whose content is the text of another text files that are in the directory $DIRMAIL at this moment.
I will show you an example:
- On the one hand, there is a directory $DIRMAIL where there are... (1 Reply)
Have to read one file say sourcefile containing several words and having another folder containing several files.
Now read the first word of Sourcefile & search it into the folder consisting sevral files, and create another file with result. We hhave to pick the filename of the file in which... (3 Replies)
How can I remove all data that contain domain e.g zzgh@something.com, sdd@something.com.my and gg@something.my in one file? so that i only have data without the domain in the file.
Here is the file structure "test.out"
more test.out
1 zzztop@b.com
1 zzzulll
1 zzzullll@s.com.my
... (4 Replies)
hi,
can somebody tell me how I can create a text file with content from Bash script.
The file should be prefilled with information such as current date and time then leaving the user ability to input more data right below those prefilled content.
thank you :) (0 Replies)
Hi,
I have a text file that has a long multi-line db2 CTE query. Now I want to store all the contents of this file (i.e. the entire query) in a shell script variable. I am trying to achieve it by this: query = `cat /Folder/SomeFile.txt` But when I echo the contents of this file by saying echo... (4 Replies)
I now have a 230,000+ lines long text file formatted in segments like this:
Is there a way to sort this file to have everything in chronological order, based on the date and time in the text? In this example, I would like the result to be: (19 Replies)
Hi
I need some help using shell script to edit a file.
My original file has the following format:
/txt/email/myemail.txt
/txt/email/myemail2.txt
/pdf/email/myemail.pdf
/pdf/email/myemail2.pdf
/doc/email/myemail.doc
/doc/email/myemail2.doc
I need to read each line. If the path is... (3 Replies)