Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Answers to Frequently Asked Questions How to split a dat file based on another file ni UNIX? Post 302996700 by pogo on Monday 1st of May 2017 03:13:03 AM
Old 05-01-2017
How to split a dat file based on another file ni UNIX?

i have two files , one is var.txt and another res.dat file

var.txt contains informaton like below
Code:
date,request,sales,item

20171015,1,123456,216

20171015,1,123456,217

20171015,2,345678,214

20171015,3,456789,218

and res.dat contains is a one huge file contains information like below
Code:
RTCCVB01 213456 123456 216

.

.

.

.

.

.

VBPCVB01

RTCCVB01 213456 345678 214

.

.

.

.

.

.

VBPCVB01

RTCCVB01 213456 123456 217

.

.

.

.

.

.

VBPCVB01

RTCCVB01 213456 456789 218

.

.

.

.

.

.

VBPCVB01

For a unique request i have to create a separate dat file, for example

for Request 1

123456.dat
Code:
RTCCVB01 213456 123456 216

.

.

.

.

.

.

VBPCVB01

RTCCVB01 213456 123456 217

.

.

.

.

.

.

VBPCVB01

for Request 2 345678.dat
Code:
RTCCVB01 213456 345678 214

.

.

.

.

.

.

VBPCVB01

for Request 3 456789.dat
Code:
RTCCVB01 213456 456789 218

.

.

.

.

.

.

VBPCVB01

sales occur at 50-56 position in res.dat file item occur at 72-79 position in res.dat file

i have to write a shell script which will do below for each unique request from var.txt it will take sales and item and extract information from res.dat and will be creating separate dat files till all request number is done .

Last edited by vbe; 05-01-2017 at 05:28 AM.. Reason: code tags please
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to attach an excel file/ dat file thru unix mails

Hi. I want to attach a .xls or .dat file while sending mail thru unix. I have come across diff attachments sending options, but allthose embeds the content in the mail. I want the attachement to be send as such. Please help me out. regards Diwakar (1 Reply)
Discussion started by: diwakar82
1 Replies

2. Shell Programming and Scripting

How to read from a .dat file in Unix

Hi All, I have a .dat file named test.dat where I have stored some process IDs. Now I need to pick a process ID, one by one and then fire kill -9 for each of those. The logic should be: 1. open file <filename.dat> 2. read until last line of file 3. if process ID is found fire kill -9... (5 Replies)
Discussion started by: Sibasish
5 Replies

3. UNIX for Dummies Questions & Answers

How do I delete a data string from a .dat file in unix

I have a .dat file in unix and it keeps failing file validation on line x. How do I delete a data string from a .dat file in UNIX? I tried the following: sed -e 'data string' -e file name and it telling me unrecognized command (4 Replies)
Discussion started by: supergirl3954
4 Replies

4. Shell Programming and Scripting

Performance issue in UNIX while generating .dat file from large text file

Hello Gurus, We are facing some performance issue in UNIX. If someone had faced such kind of issue in past please provide your suggestions on this . Problem Definition: /Few of load processes of our Finance Application are facing issue in UNIX when they uses a shell script having below... (19 Replies)
Discussion started by: KRAMA
19 Replies

5. Shell Programming and Scripting

How to add spaces to test.dat file in unix??

Hi I have a test.dat file in UNIX which has a data.I am informatica developer i get data in those files.I need to add 50 spaces to those data in test.dat file.I am new to unix So can any one help how can i do that. I have some 2088 rows in that test.dat file. Can anyone help me please its... (11 Replies)
Discussion started by: karingulanagara
11 Replies

6. Shell Programming and Scripting

Remove <CR><LF> from the dat file in unix

Hi, The source system has created the file in the dat format and put into the linux directory as mentioned below. I want to do foloowing things. a) Delete the Line started with <CR><LF> in the record b)Also line ...........................................................<CR><LF> ... (1 Reply)
Discussion started by: mr_harish80
1 Replies

7. Shell Programming and Scripting

Split a file into multiple files based on first two digits of file.

Hi , I do have a fixedwidth flatfile that has data for 10 different datasets each identified by the first two digits in the flatfile. 01 in the first two digit position refers to Set A 02 in the first two digit position refers to Set B and so on I want to genrate 10 different files from my... (6 Replies)
Discussion started by: okkadu
6 Replies

8. Shell Programming and Scripting

Split file based on file size in Korn script

I need to split a file if it is over 2GB in size (or any size), preferably split on the lines. I have figured out how to get the file size using awk, and I can split the file based on the number of lines (which I got with wc -l) but I can't figure out how to connect them together in the script. ... (6 Replies)
Discussion started by: ssemple2000
6 Replies

9. Shell Programming and Scripting

How to split file into multiple files using awk based on 1 field in the file?

Good day all I need some helps, say that I have data like below, each field separated by a tab DATE NAME ADDRESS 15/7/2012 LX a.b.c 15/7/2012 LX1 a.b.c 16/7/2012 AB a.b.c 16/7/2012 AB2 a.b.c 15/7/2012 LX2 a.b.c... (2 Replies)
Discussion started by: alexyyw
2 Replies

10. Shell Programming and Scripting

Date format change in UNIX .dat file

Hi, I need help to convert the date format in .DAT file in unix. I want to convert 10@@|SWIFT MT568 Extract@@|Apr 14 2014 5:47:52:563PM@@|Apr 14 2014 4:33:47:663PM@@||##| into 10@@|SWIFT MT568 Extract@@|04/14/2014/ 5:47:52:563PM@@|04/14/2014 4:33:47:663PM@@||##| Appreciate... (18 Replies)
Discussion started by: karthikengox
18 Replies
update-fontlang(8)					       Debian User's Manual						update-fontlang(8)

NAME
update-language, update-fmtutil, update-fmtlang - update various TeX-related configuration files SYNOPSIS
update-language [options] update-fmtutil [options] DESCRIPTION
This manual page explains briefly the usage of the three TeX configuration update programs update-language and update-fmtutil. The update-fontlang script should not be called directly, but only via the two described links. For a more in-depth description, please see the document TeX on Debian in /usr/share/doc/tex-common/TeX-on-Debian.txt.gz (also available as HTML and PDF). The programs update-language and update-fmtutil create or update the configuration files language.dat and fmtutil.cnf, respectively. These files define the hyphenation patterns to be loaded into LaTeX-related TeX formats (language.dat), and the list of formats to be created (fmtutil.cnf). These programs can be used either in system-wide mode if called by root, or in a user-specific mode if called by a user without super-user privileges. OPTIONS
-c DIR, --conf-dir=DIR directory where the user-specific configuration files are looked for in user-specific mode (default TEXMFCONFIG/language.d for update-language and TEXMFCONFIG/fmt.d for update-fmtutil, where TEXMFCONFIG is usually $HOME/.texmf-config). -o FILE, --output-file=FILE file to write the output to. Per default, in system-wide mode, update-language writes to /var/lib/texmf/tex/generic/config/lan- guage.dat and update-fmtutil writes to /var/lib/texmf/web2c/fmtutil.cnf. --checks perform sanity checks on the generated config file. Don't use this in maintainer scripts. --quiet don't write anything to the standard output during normal operation --help print a summary of the command-line usage and exit --version output version information and exit USAGE
In system-wide mode, both programs merge those files ("configuration snippets") with a specific extension in the respective configuration directories to produce the final file. These configuration directories and extensions are language.d and .cnf for update-language, and fmt.d and .cnf for update-fmtutil. In system-wide mode, these directories are those under /etc/texmf/. Both TeX add-on packages and local administrators can add files to these directories. If a package that provides such snippets is removed but not purged, including the snippet will likely break the system. To prevent the inclusion in these cases, snippets installed by packages have to contain a magic header: # -_- DebPkgProvidedMaps -_- which local administrators should not remove. From the files with a magic header, only those files which are also listed in one of the files in /var/lib/tex-common/language-cnf/ for update-language, and /var/lib/tex-common/fmtutil-cnf/ for update-fmtutil, are actually included into the final output file. This way, local changes to the configuration can be preserved while the package is in state 'rc' (that is, the package is removed, but its configuration files are still present). For details about this mechanism, package maintainers should consult the Debian TeX Policy. As a special case, the files for JadeTeX and xmlTeX are only included if there is already a file for the LaTeX format (see TeX on Debian for details). The user-specific mode provides a way for a non-admin user to override system-wide settings. In this mode, update-language writes to TEXM- FVAR/tex/generic/config/language.dat, and update-fmtutil writes to TEXMFVAR/web2c/fmtutil.cnf, where TEXMFVAR is usually $HOME/.texmf-var. Furthermore, files present within the user-specific configuration directories are included in addition to the files present in the system- wide configuration directories. In case the same filename exists in the system-wide configuration directory and the user-specific configu- ration directory, the user-specific file is used instead of the system-wide one. The user-specific configuration directories are TEXMFCON- FIG/language.d for update-language and TEXMFCONFIG/fmt.d for update-fmtutil, where TEXMFCONFIG is usually $HOME/.texmf-config. The system- wide configuration directories have the same names, but are located in /etc/texmf/ instead of TEXMFCONFIG. Note that changes introduced by updates of packages are not propagated to the user's configuration files. This has to be done by hand. FILES
/var/lib/texmf/tex/generic/config/language.dat This file is generated or updated by update-language in system-wide mode and contains a list of the hyphenation patterns loaded into LaTeX-based formats by fmtutil-sys. /var/lib/texmf/web2c/fmtutil.cnf This file is generated or updated by update-fmtutil in system-wide mode and contains a list of formats to be generated by fmtutil- sys. /etc/texmf/language.d/name.cnf Input files for update-language /etc/texmf/fmt.d/name.cnf Input files for update-fmtutil /var/lib/tex-common/language-cnf/package.list Lists the file(s) installed by package in /etc/texmf/language.d/. /var/lib/tex-common/fmtutil-cnf/package.list Lists the file(s) installed by package in /etc/texmf/fmt.d/. SEE ALSO
fmtutil(1), fmtutil-sys(1) The programs actually using the generated configuration files (language.dat and fmtutil.cnf). TeX on Debian Documentation to be found in /usr/share/doc/tex-common/TeX-on-Debian.txt.gz (also available as HTML and PDF), describing in more detail how to setup and maintain a TeX system in Debian. It also includes details on user-specific configuration. Debian TeX Policy to be found in /usr/share/doc/tex-common/Debian-TeX-Policy.txt.gz (also available as HTML and PDF), describing the internals and the TeX Policy established on the Debian TeX mailing-list (debian-tex-maint@lists.debian.org). Intended audience is mainly developers packaging TeX-related resources for Debian. dh_installtex(1) a debhelper-like script for managing the installation of files into the system-wide configuration directories; this script helps to write Debian packages containing TeX-related resources that conform to the Debian TeX Policy. AUTHOR
This manual page was written by Norbert Preining <preining@debian.org> for the Debian distribution (and may be used by others). It was later updated by Florent Rougon <f.rougon@free.fr>. Debian 2006-12-11 update-fontlang(8)
All times are GMT -4. The time now is 12:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy