Text processing/1: Difference between revisions

Content added Content deleted
(cd intro)
(Undo revision 202589 by Peak (talk) (apart from lead->led.))
Line 1: Line 1:
{{task|Text processing}}{{Template:clarify task}}
{{task|Text processing}}{{Template:clarify task}}
Often the format of data produced by one program is unsuitable for another program or person. In such situations, another program can be written to transform the original data into a suitable format. The term "data munging" is [http://www.google.co.uk/search?q=%22data+munging%22 often] used in programming circles for this task.
Often data is produced by one program, in the wrong format for later use by another program or person. In these situations another program can be written to parse and transform the original data into a format useful to the other. The term "Data Munging" is [http://www.google.co.uk/search?q=%22data+munging%22 often] used in programming circles for this task.


A [http://groups.google.co.uk/group/comp.lang.awk/msg/0ecba3a3fbf247d8?hl=en request] on the comp.lang.awk newsgroup led to a typical data munging task:
A [http://groups.google.co.uk/group/comp.lang.awk/msg/0ecba3a3fbf247d8?hl=en request] on the comp.lang.awk newsgroup led to a typical data munging task:
Line 31: Line 31:
Only a sample of the data showing its format is given above. The full example file may be downloaded [http://rosettacode.org/resources/readings.zip here].
Only a sample of the data showing its format is given above. The full example file may be downloaded [http://rosettacode.org/resources/readings.zip here].


Structure your program to show statistics for each line of the file (along the lines of the Python, Perl, and AWK examples originally provided on this page), followed by summary statistics for the file. When showing example output, just show a few line statistics together with complete overall summary.
Structure your program to show statistics for each line of the file, (similar to the original Python, Perl, and AWK examples below), followed by summary statistics for the file. When showing example output just show a few line statistics and the full end summary.


=={{header|Ada}}==
=={{header|Ada}}==