08-09-2007
Extracting data from text file based on configuration set in config file
Hi ,
a:) i have configuration file with pattren
<Range start no>,<Range end no>,<type of records to be extracted from the data file>,<name of the file to store output>
eg:
myfile.confg
9899000000,9899999999,DATA,b.dat
9899000000,9899999999,SMS,a.dat
b:) Stucture of my data file is :
<no>,<type of record>
eg
maindatafile.dat
9899000000,SMS
9899000001,DATA
989901,DATA
Now i want to extract the records from main file
Condition
One check is of range and other will be of Record type defined in configuration file
Output should be like :
File Name : >>>>> b.dat
9899000001,DATA
Similarly seperate files based on range and Record type should be created.
Can anybody help to get this achieved in best possible way...
Thanks in Advance
Last edited by zazzybob; 08-09-2007 at 08:30 AM..
Reason: Disabled smilies
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i have textfiles that contain a series of lines that look like this:
string0 .................................................... column3a column4a
string1**384y0439 ..................................... column3b column4b... (2 Replies)
Discussion started by: Deanne
2 Replies
2. Shell Programming and Scripting
Input file is on Linux box and the input file has data in just one line with 1699741696 characters.
Sample Input:
<xxx><document coll="uspatfull" version="0"><CMSdoc>xxxantivirus</CMSdoc><tag1>1</tag1></document><document coll="uspatfull"... (5 Replies)
Discussion started by: gaya
5 Replies
3. Shell Programming and Scripting
Hi there,
Can you help. I need to extract data based on the list file(list.txt) from item.txt as shown below. Please note the actual files are enormous in size. Thank you.
item.txt
nokia1100 123,000
nokia2100 66,000
samsung123 11,000
samsung456 23,000
iphone432 234,000... (12 Replies)
Discussion started by: shtobias
12 Replies
4. UNIX for Dummies Questions & Answers
I have a tab delimited text file where the first column can take on three different values : 100, 150, 250. I want to extract all the rows where the first column is 100 and put them into a separate text file and so on. This is what my text file looks like now:
100 rs3794811 0.01 0.3434... (1 Reply)
Discussion started by: evelibertine
1 Replies
5. UNIX for Dummies Questions & Answers
I have a tab delimited text file where the first column can take on three different values : 100, 150, 250. I want to extract all the rows where the first column is 100 and put them into a separate text file and so on. This is what my text file looks like now:
100 rs3794811 0.01 0.3434
100... (1 Reply)
Discussion started by: evelibertine
1 Replies
6. Shell Programming and Scripting
I have a .kml file. So I want filter the .kml to get only the tags that have this numeric codes that they are in a text file
11951
11952
74014
11964
11965
11969
11970
11971
11972
60149
74018
74023
86378
11976
11980
11983
11984
11987 (5 Replies)
Discussion started by: pcoj33
5 Replies
7. Shell Programming and Scripting
Hi experts,
I need a help in extracting a set of patterns from the text file.
Below is my scenario.
Input file:
I need to extract the data between
My output should be as
Thanks,
Kalai (7 Replies)
Discussion started by: kalpeer
7 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I am trying to extract lines from a text file given a text file containing line numbers to be extracted from the first file. How do I go about doing this? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies
9. UNIX for Dummies Questions & Answers
Dear All,
I have two files but want to extract data from one based on another... can you please help me
file 1
David
Tom
Ellen
and file 2
David|0010|testnamez|resultsz
David|0004|testnamex|resultsx
Tom|0010|testnamez|resultsz
Tom|0004|testnamex|resultsx
Ellen|0010|testnamez|resultsz... (12 Replies)
Discussion started by: A-V
12 Replies
LEARN ABOUT SUSE
apt-config
APT-CONFIG(8) APT APT-CONFIG(8)
NAME
apt-config - APT Configuration Query program
SYNOPSIS
apt-config [--empty] [--format '%f "%v";%n'] [-o=config_string] [-c=config_file] {shell | dump | {-v | --version} | {-h | --help}}
DESCRIPTION
apt-config is an internal program used by various portions of the APT suite to provide consistent configurability. It accesses the main
configuration file /etc/apt/apt.conf in a manner that is easy to use for scripted applications.
Unless the -h, or --help option is given, one of the commands below must be present.
shell
shell is used to access the configuration information from a shell script. It is given pairs of arguments, the first being a shell
variable and the second the configuration value to query. As output it lists shell assignment commands for each value present. In a
shell script it should be used as follows:
OPTS="-f"
RES=`apt-config shell OPTS MyApp::options`
eval $RES
This will set the shell environment variable $OPTS to the value of MyApp::options with a default of -f.
The configuration item may be postfixed with a /[fdbi]. f returns file names, d returns directories, b returns true or false and i
returns an integer. Each of the returns is normalized and verified internally.
dump
Just show the contents of the configuration space.
OPTIONS
All command line options may be set using the configuration file, the descriptions indicate the configuration option to set. For boolean
options you can override the config file by using something like -f-,--no-f, -f=no or several other variations.
--empty
Include options which have an empty value. This is the default, so use --no-empty to remove them from the output.
--format '%f "%v";%n'
Defines the output of each config option. %t will be replaced with its individual name, %f with its full hierarchical name and %v with
its value. Use uppercase letters and special characters in the value will be encoded to ensure that it can e.g. be safely used in a
quoted-string as defined by RFC822. Additionally %n will be replaced by a newline, and %N by a tab. A % can be printed by using %%.
-h, --help
Show a short usage summary.
-v, --version
Show the program version.
-c, --config-file
Configuration File; Specify a configuration file to use. The program will read the default configuration file and then this
configuration file. If configuration settings need to be set before the default configuration files are parsed specify a file with the
APT_CONFIG environment variable. See apt.conf(5) for syntax information.
-o, --option
Set a Configuration Option; This will set an arbitrary configuration option. The syntax is -o Foo::Bar=bar. -o and --option can be
used multiple times to set different options.
SEE ALSO
apt.conf(5)
DIAGNOSTICS
apt-config returns zero on normal operation, decimal 100 on error.
BUGS
APT bug page[1]. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command.
AUTHORS
Jason Gunthorpe
APT team
NOTES
1. APT bug page
http://bugs.debian.org/src:apt
APT 1.6.3ubuntu0.1 30 November 2013 APT-CONFIG(8)