Simon336697
asked on
Making a summary text file.
Hi guys,
I hope you are well and can help.
I have a text file called "sorted_a.txt".
The format of this file is as follows:
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --- sorted_a.txt
abalone -- this is the definition of abalone;
adversary -- this is the defintion;
aeroplane -- this is another meaning;
at the park -- this is at the park;
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---
I'd like to produce a script that will....
Examine the contents of soreted_a.txt, and treat each block of word or words before the "--" is treated as a single "chunk" per line.
Each of these chunks is copied to a new file called "summary_sorted_a.txt"
Each chunk in this new file is separated from each other by a comma.
The last chunk of the new file will be ended by a semicolon.
An example of its output using the above sorted_a.txt file would be:
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --- summary_sorted_a.txt
abalone, adversary, aeroplane, at the park;
Any help greatly appreciated.
I hope you are well and can help.
I have a text file called "sorted_a.txt".
The format of this file is as follows:
--------------------------
abalone -- this is the definition of abalone;
adversary -- this is the defintion;
aeroplane -- this is another meaning;
at the park -- this is at the park;
--------------------------
I'd like to produce a script that will....
Examine the contents of soreted_a.txt, and treat each block of word or words before the "--" is treated as a single "chunk" per line.
Each of these chunks is copied to a new file called "summary_sorted_a.txt"
Each chunk in this new file is separated from each other by a comma.
The last chunk of the new file will be ended by a semicolon.
An example of its output using the above sorted_a.txt file would be:
--------------------------
abalone, adversary, aeroplane, at the park;
Any help greatly appreciated.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
... and the good news is that GNU tools like cat and awk are available for windows as well, both in native and unix-like flavours.
ASKER
Guys thanks so much again. That works great. Thank you .