Sponsored Content
Top Forums UNIX for Dummies Questions & Answers looping through file and creating seperate files Post 302575919 by amitbakre on Wednesday 23rd of November 2011 08:37:45 AM
Old 11-23-2011
looping through file and creating seperate files

Hi,
My first post!!

I have a files with header, something like this

Header_Row
AMC|D1|D2|D2
AAO|D3|D4|D5
AMC|D6|D7|D8
AAO|D9|D10|D11
.
.
.
.
.
and millions fo records thereafter like this.

I want to read the above file in a loop and write the lines having AMC into another file and having AAO into another and I also want to skip the header record before doing this.

Please help me I have no clue in which direction should i move.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Split File into seperate files

Hi, So I have a text file which I want to separate into separate text files. I would use the split command but the problem here is that the text file is separated by delimiters. For example: blah blah blah ------ more text ----- and some more text So basically the first part should be... (4 Replies)
Discussion started by: eltinator
4 Replies

2. UNIX for Dummies Questions & Answers

comparing strings in seperate files

Hello, I am comparing files with for mismatches using fgrep but I've run into a problem. fgrep -vf $file1 $file2 > mismatches.dat file1 and file2 both contain file names on each line file1 has filenames which are up to 92 characters long and contain the "$" char. example file name:... (2 Replies)
Discussion started by: orahi001
2 Replies

3. Solaris

Problem creating sol8 container using seperate / /usr and /var ufsdumps

Hello experts New to solaris 8 containers and zones in general and I'm having some problems creating a Solaris 8 container using ufsdumps of /, /usr and /var. I have created the zone which worked fine and a running the following command. zoneadm -z zone_s8 install -v -p -a /root.ufs ... (2 Replies)
Discussion started by: BrokeIt
2 Replies

4. UNIX for Dummies Questions & Answers

Help in Array looping and creating multiple lines

hi Gurus, I'm a newbie in scripting please check my script if this is correct. I think there's something wrong with it but I;m not sure. I'm trying to create multiple lines using awk from external xml files but i want to add additonal info in the data manually Since i don't knwo how to... (0 Replies)
Discussion started by: sexyTrojan
0 Replies

5. Homework & Coursework Questions

File Looping - Looking for executable files - Need help

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! Hello all, I have posted here before and really was blown away by the amount of assistance I received. I was able to finish my homework without a problem! But, yet again, our... (6 Replies)
Discussion started by: Bob07
6 Replies

6. Shell Programming and Scripting

While or For with looping contructs? to create files from contents of a text file

Hi so far I created this script: vi loop.beta.sh for i in `cat extract.filenames.tabc` do echo $i done>$i === This is the original text file. $ more tabc.txt -rwx------- 1 alice staff 1586 2010-11-05 02:27 request-key .conf -rwx------- 1 ted staff 126 ... (3 Replies)
Discussion started by: wolf@=NK
3 Replies

7. Shell Programming and Scripting

Not looping or creating files

So my script is supposed to repeat for every server in my file, but as of now it is getting stuck on my awk commands # Read file cred.txt (with one IP per line), connect to servers (one at a time), and download directory listing i=1 param=$(sed -n "{$1}p" $parm_dir/cdm_param.txt) #Get the last... (6 Replies)
Discussion started by: MJCreations
6 Replies

8. Shell Programming and Scripting

Seperate Odd and Even numbers from 1 file to 2 files

Hey guys. I have been trying to figure out an easy way to seperate a liste of 150k numbers (10 digits) in a .txt file into odd and even numbers with each of their own files, for a project at work. I've tried Excel, but it was too much for it and it wasnt very simple. So i gave up after... (13 Replies)
Discussion started by: TranceC
13 Replies

9. Shell Programming and Scripting

Looping the files for getting the file size information

Am using Linux 3.10 years.txt is input source file which has the list of year like below 2013 2014 2015 2016 Other Input files are XX_TEST1_YR2016_01012018.csv XX_TEST1_YR2015_01012018.csv XX_TEST1_YR2014_01012018.csv XX_TEST1_YR2013_01012018.csv XX_TEST2_YR2016_01012018.csv... (2 Replies)
Discussion started by: weknowd
2 Replies

10. UNIX for Beginners Questions & Answers

For loop for seperate files

For shell script. If I had two separate files, file.txt and file1.txt and each has just a list of names from the who command. How would I create an if loop to compare each name? (1 Reply)
Discussion started by: Eric7giants
1 Replies
AMC-ANALYSE(1)						       Auto Multiple Choice						    AMC-ANALYSE(1)

NAME
AMC-analyse - automatic data capture from scans for AMC multiple choice exams. SYNOPSIS
auto-multiple-choice analyse --projet project-dir [--seuil-coche threshold] [--tol-marque tol] [--list-fichiers files-list.txt | scan-files...] DESCRIPTION
The AMC-analyse.pl command performs automatic data capture from scans of completed answer sheets of an AMC multiple choice questionnaire. Before calling AMC-analyse.pl, AMC-prepare(1) should have been called to make working documents (--mode s) and the layout should have been processed with AMC-meptex(1). --data data-dir gives the directory where data files are (see for example AMC-meptex(1)). Defaults to project-dir/data. --cr project-cr-dir gives a directory where to create image reports of the data capture (zooms on the boxes in a zooms sub-directory, name filed extraction as a name-*.jpg file, and layout report as a page-*.jpg file). --projet project-dir When using this option, if --cr is not used, project-cr-dir will be set to project-dir/cr. Giving the names of the scan files to process can be done in two ways: o these names can be given as arguments, o these names can be written to a plain file (one filename per line), using the --list-fichiers files-list.txt to give the name of this file. Some parameters for data capture may be set using the following options: --prop proportion sets the proportion of each box that will be measured to decide if the box is ticked or not. Default value is 0.8. --seuil-coche threshold When deciding whether a box is checked or not, AMC-analyse.pl compares the black ratio (number of black pixels over total number of pixels) to threshold. If the black ratio is greater then threshold, the box is declared to be checked. Standard values can be 0.15 in the standard layout, or 0.5 for separate answer sheet layout (in this last case, letters are drawn in the boxes, and the students are told to fill the boxes entirely). The black ratio is written in the data capture reports, so that this threshold value can be refined later without calling AMC-analyse.pl again. --bw-threshold threshold This parameter is used when converting the grayscale scan file to black and white. To get more black pixels, use a greater value. To get more white pixels, use a smaller value. The threshold must be between 0 and 1. The default value is 0.6. --ignore-red With this option, only red channel will be used from color scans. This way, all that is written in red will be ignored in the scan. This can be useful when the boxes are printed in red. --tol-marque tol defines the tolerance when detecting the four marks in the scans corners. These marks are detected looking for black connected components which dimensions are closed to the target dimension target (exact dimensions of the marks if printing/scanning process where perfectly acurate). If tol is a real number, accepted dimensions are those between (1-tol)*target and (1+tol)*target. If tol is "tinf,tsup" (where tinf and tsup are real numbers), accepted dimensions are those between (1-tinf)*target and (1+tsup)*target. A standard value is 0.2. --multiple This option is to be used when the scans are photocopies from some subjects (different students can have the same subject). In thie case, copy numbers are allocated to students so that their answer sheets, with the same subject number, can be differenciated. --pre-allocate copy_id This option can be used in conjonction with --multiple. The copy numbers used for the scans will start from copy_id, in the same order than the scans given as arguments. --debug file.log gives a file to fill with debugging information. AUTHORS
Alexis Bienvenue <paamc@passoire.fr> Main author Jean Berard Translation from French Georges Khaznadar Translation from French COPYRIGHT
Copyright (C) 2008-2012 Alexis Bienvenue This document can be used according to the terms of the GNU General Public License, version 2 or later. Auto Multiple Choice 1.1.1 06/19/2012 AMC-ANALYSE(1)
All times are GMT -4. The time now is 10:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy