10-03-2010
The sed tool is pretty good at this sort of thing, except line counting: the closest it gets is line numbers. PERL, C. C==, JAVA, etc. can do it, being full languages. You can use a combination of shell tools with sed to break up the information into multiple files and measure the files, processing one set of data from a file at a time, if necessary. Trying to do it all in shell itself might be too slow.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi All,
Not sure if this would be in a dummies sectiin or advanced. I'm looking for a script if someone has doen something like this.
I have list of files -
adc_earnedpoints.20070630.txt
adc_earnedpoints.20070707.txt
adc_earnedpoints.20070714.txt
adc_earnedpoints.20070721.txt... (1 Reply)
Discussion started by: thebeginer
1 Replies
2. UNIX for Dummies Questions & Answers
Hi all,
I have the following shell script code which tries to sftp and writes the log into the log file.
TestConnection ()
{
echo 'Connection to ' $DESTUSERNAME@$DESTHOSTNAME
$SETDEBUG
if ]; then rm $SCRIPT ; fi
touch $SCRIPT
echo "cd" $REMOTEDIR >> $SCRIPT
echo "quit" >>... (10 Replies)
Discussion started by: valluvan
10 Replies
3. Programming
Hello everybody,
I'm trying to code a program which makes the following:
It sends an ARP request frame and when it gets the reply, extracts the IP address of source and writes it to a .txt file. This is gonna be done with many hosts (with a for() loop), so, the text file would look like... (2 Replies)
Discussion started by: Zykl0n-B
2 Replies
4. Shell Programming and Scripting
Hi Folks,
I have a file without any delimeters and it is a flat file. Example,
my raw data looks: x25abcy26defz27ghi.....
Now, could you please any one help me to program to split this into variable and create a text file. I want a output as below
Name Age Number
x 25 abc... (14 Replies)
Discussion started by: Jerald Nathan
14 Replies
5. Shell Programming and Scripting
I have a requirement to read the xml file and split the files into two diffrent files in Unix shell script. Could anyone please help me out with this requirement.
Sample file
---------------
0,<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Information... (3 Replies)
Discussion started by: kmanivan82
3 Replies
6. Shell Programming and Scripting
Hi,
I have more than 30,000 records in a flat file. I want to remove footer from the file by searching a string pattern for the footer.
Example.... let the flat file test.dat contains below records.
record1
record2
record3
..
..
..
record31000
Total records 31000
I want to remove the... (6 Replies)
Discussion started by: gani_85
6 Replies
7. Shell Programming and Scripting
Hi
I am trying to extract information out of a file but keep getting grep cant open errors
the code is below:
#bash
#extract orders with blank address details
#
# obtain the current date
# set today to the current date ccyymmdd format
today=`date +%c%m%d | cut -c24-31`
echo... (8 Replies)
Discussion started by: Bruble
8 Replies
8. Shell Programming and Scripting
hi
i have written a script for reading a csv file and creating a flat file, suggest if this script can be optimized
#----------------
FILENAME="$1"
SCRIPT=$(basename $0)
#-----------------------------------------//
function usage
{
echo "\nUSAGE: $THIS_SCRIPT file_to_process\n"... (3 Replies)
Discussion started by: mprakasheee
3 Replies
9. Shell Programming and Scripting
Hi All,
Here is my requirement. I am grepping through the log files and cutting some fields from the file to generate a csv file. Now I have to check if 2nd field is having some fixed value then with the help of 4th field I have to look in same log and run another grep command to retrieve the... (11 Replies)
Discussion started by: kmajumder
11 Replies
10. Programming
is there any unix tools that can read the text files like through SQL queries? (ie in Hadoop, Impala DB support flat file query) (1 Reply)
Discussion started by: omykarshan
1 Replies
LEARN ABOUT DEBIAN
ch_lab
CH_LAB(1) BSD General Commands Manual CH_LAB(1)
NAME
ch_lab -- change/copy label files
SYNOPSIS
ch_lab [-S frame spacing] [-start time] [-end time] [-ext file extension] [-extract file] [-extend time] [-f sample frequency]
[-lf sample frequency] [-itype file type] [-key key file] [-lablist list of labels] [-length time] [-map map file]
[-name feature name] [-class class] [-o output file] [-otype file type] [-pad high | low] [-pos list of labels] [-q timestep]
[-range range] [-sed sed file] [fl shift time delta] [-style output stype] [-vocab vocab file] [-verify] [-nopath] [-base] [-combine]
[-divide] [-h] input files ...
DESCRIPTION
ch_lab copies from one or more input label files to an output label file, optionally performing various operations along the way.
The following option flags are recognized:
-h Print a summary of usage to standard output.
-S frame spacing
frame spacing of output
-start time
start time, in seconds, for label extraction
-end time
end time, in seconds, for label extraction
-ext file extension
filename extension to use for multiple output files
-extract file
extract a single file from a list of files
-extend time
extend track file by time seconds beyond label file
-f sample frequency
sample frequency of label file
-lf sample frequency
sample frequency for labels
-itype file type
type of input label file: esps htk ogi
-key key file
key label file
-lablist list
list of labels to be considered as blank
-length time
length of track produced, in seconds
-map map file
label mapping file
-name feature name
eg. Fo Phoneme
-class class
name of class defined in op file
-o output file
output file name
-otype file type
output file type: xmg, ascii, esps, htk
-pad high | low
pad with high or low values
-pos list
list of labels to be regarded as 'pos'
-q timestep
quantize label timings to nearst value
-range range
difference between high and low values
-sed sed file
perform regex editing using sed file
fl shift time delta
shift the times of the labels
-style output style
output style e.g. track
-vocab file
file containing list of words in vocabulary
-verify
check that only labels in vocab file are in label file
-nopath
ignore pathnames when searching label lists
-base
use base filenames for lists of label files
-combine
-divide
SEE ALSO
ch_wave(1) ch_track(1)
Edinburgh Speech Tools April 5, 2001 Edinburgh Speech Tools