Sponsored Content
Top Forums Shell Programming and Scripting How to read particular line in file from specific column? Post 302762181 by nex_asp on Monday 28th of January 2013 08:01:59 AM
Old 01-28-2013
Thank you so much....whether pamu its possible to convert binary file to ascii completely..in shell...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Retrieve line from a file based on a value in specific column

Hi, I have a file that has several values seperated by ":" 2006:John:Student:Football:Portugal:Cinema 2006:James:Engineer:Basket:Poland:Theatre 2007:Lucy:Diver:Gymnastic:England:Music 2007:Smith:Plumber:Basket:Spain:Poker I need make a filter based on the 5th field to find countries that... (1 Reply)
Discussion started by: efernandes
1 Replies

2. Shell Programming and Scripting

How to read the value from a specific line and column in to a csh variable

Hi All, Although its a basic question the last 2 hours of googling and trying didnt help me to achieve what i want. Maybe some one can help me I have a text file text1.txt: blablablabla A B C D E F and i would like to read to read what is on position E (line 3 column 2) in a... (2 Replies)
Discussion started by: Radamez
2 Replies

3. Shell Programming and Scripting

A script that read specific fileds from the 7th line in a file

Dear All, I need a unix script that will read the 7th line and especially these fileds from a file Mo speed 16, Mt speed 15 every 15 minutes starting from 00:00 to 23:45 on daily basis and put the result in a txt file and name it MT_MO_20090225.txt, please also note that the system date format... (2 Replies)
Discussion started by: samura
2 Replies

4. Shell Programming and Scripting

How to read the value from a specific line and column BASH

Hi All, I have the same problem as the one posted in https://www.unix.com/shell-programming-scripting/96097-how-read-value-specific-line-column-csh-variable.html but I'm using bash. Can anyone tell me how I have to modify the code to make it bash compatible? eval `awk 'NR==3{print "set... (5 Replies)
Discussion started by: f_o_555
5 Replies

5. Shell Programming and Scripting

read file line by line print column wise

I have a .csv file which is seperated with (;) inputfile --------- ZZZZ;AAAA;BBB;CCCC;DDD;EEE; YYYY;BBBB;CCC;DDDD;EEE;FFF; ... ... reading file line by line till end of file. while reading each line output format should be . i need to print only specific columns let say 5th... (2 Replies)
Discussion started by: rocking77
2 Replies

6. Shell Programming and Scripting

how read specific line in a file and write it in a new text file?

I have list of files in a directory 'dir'. Each file is of type HTML. I need to read each file and get the string which starts with 'http' and write them in a new text file. How can i do this shell scripting? file1.html <head> <url>http://www.google.com</url> </head> file2.html <head>... (6 Replies)
Discussion started by: vel4ever
6 Replies

7. Shell Programming and Scripting

Read file from nth line to specific character

Hi, I want to read the file from nth line (where n is an integer) to until I encounter @ char. Can any one please help me how to do this? Thanks. (3 Replies)
Discussion started by: laalesh
3 Replies

8. Shell Programming and Scripting

How to grep an empty line in a specific column of a file?

Suppose i have the following data : cat file.txt 12431,123334,55353,546646,14342234,4646,35234 123123,3535,123434,132535,1234134,13535,123534 123213,545465,23434,45646,2342345,4656,31243 2355425,2134324,53425,342,35235,23434,234535 3423424,234234,65465,,2344,35436,234524,234... (7 Replies)
Discussion started by: Ravi Tej
7 Replies

9. Shell Programming and Scripting

To read specific line from a file

Hi, I have a ldif file like below: version: 1 dn: cn=Test Group,ou=Applications,dc=xyz,dc=com objectClass: groupOfUniqueNames objectClass: top cn: Test Group uniqueMember: uid=abc,ou=People,o=xyz,o=Corporate,dc=xyz,dc=com dn: cn=Test Sub Group,cn=Test... (4 Replies)
Discussion started by: saurau
4 Replies

10. Shell Programming and Scripting

Overwrite specific column in xml file with the specific column from adjacent line

I have an xml file dumped from rrd file, that I want to "patch" so the xml file doesn't contain any blank hole in the resulting graph of the rrd file. Here is the file. <!-- 2015-10-12 14:00:00 WIB / 1444633200 --> <row><v> 4.0419731265e+07 </v><v> 4.5045912770e+06... (2 Replies)
Discussion started by: rk4k
2 Replies
TYPERULES(5)							File Formats Manual						      TYPERULES(5)

NAME
typerules - HylaFAX file type identification and conversion rules DESCRIPTION
Only three types of files are accepted by the HylaFAX server for transmission as facsimile: POSTSCRIPT(R) files, PDF files, and TIFF Class F (bilevel Group 3-encoded) files. All other types of files must be converted to one of these three formats. The facsimile submission program applies a set of rules against the contents of each input file to identify the file's type and to figure out how to convert the file to a format that is suitable for transmission. These rules are stored in the file /etc/hylafax/typerules, an ASCII file that is pat- terned after the /etc/magic file used by the System V file(1) program. However, there are significant differences, noted below. Type rules work by matching data patterns in a file; typically patterns that appear in the first few bytes of the file (i.e. magic num- bers). There are two types of rules, primary rules and secondary rules. Secondary rules specify additional rules to apply after a primary rule has been matched. When secondary rules are used, rule scanning continues up to the next primary type rule in the file. Each rule consists of a set of whitespace-separated fields: offset datatype match result command If an line is terminated wth a backslash character, the entry is continued on the next line with any leading whitespace characters com- pressed to a single space. Comments are marked with the ``#'' character; everything from to the end of the line is discarded. Secondary rules have a ``>'' character in the first column of the line; primary rules do not. The fields in each rule entry are: offset The byte offset in the file at which data should be extracted and compared to a matching string or value. datatype The type of data value to extract at the specified offset for comparison purposes; one of: ``byte'' (8 bit unsigned number), ``short'' (16 bit unsigned number), ``long'' (32 bit unsigned number), ``string'' (an array of bytes), ``istring'' (a case-insen- sitive array of bytes), or ``ascii'' (an array of ASCII-only bytes). match The value and operation to use in matching; the value used is based on the datatype field. If value is ``x'', then it is inter- preted to mean match anything; otherwise the following operators are supported (where data is the value extracted from the file and value is specified in the match field) except for types ``string'', ``istring'', and ``ascii'': = data == value != data != value > data > value < data < value <= data <= value >= data >= value & (data & value) == value ! (data & value) != value ^ (data ^ value) != 0 If no operation is specified then ``='' is used. For ``string'', ``istring'', and ``ascii'' no operator is allowed; the implicit operation is always ``=''. In these cases, the field is terminated by a tab or end of line, not by ``#''. Characters in the field have their literal value; there are no C-style character escapes. result One of ``ps'', ``tiff'', or ``error'' (case insensitive). The first two results specify whether the rule generates a POSTSCRIPT file or a TIFF/F file (Group 3-encoded bilevel data), respectively. The ``error'' result indicates that a file is unsuitable for transmission and, if supplied for transmission, should cause the job to be aborted with the command field used in an error mes- sage. command A command description that is expanded and passed to the shell to convert the input file to the result format (suitable for send- ing as facsimile). Before the string is passed to the shell, it is scanned and the following ``%'' escape codes are substituted for: %i input file name %o output file name %r output horizontal resolution in pixels/mm %R output horizontal resolution in pixels/inch %v output vertical resolution in lines/mm %V output vertical resolution in lines/inch %f data format, ``1'' for 1-d encoding or ``2'' for 2-d encoding %w page width in pixels %W page width in mm %l page length in pixels %L page length in mm %s page size by name %F the directory where HylaFAX filter programs reside %<x> the <x> character (e.g. ``%%'' results in ``%'' See below for example uses of these codes. EXAMPLES
The following rules are used to match the formats that are handled directly by the server: #offset datatype match result command 0 string %! ps # POSTSCRIPT 0 string %PDF ps # POSTSCRIPT by Ghostscript 0 short 0x4d4d tiff # big-endian TIFF 0 short 0x4949 tiff # little-endian TIFF These rules are used to process the ASCII version of IRIS Inventor database files while blocking the transmission of the binary format variant: #offset datatype match result command 0 string #Inventor V error IRIS Inventor file >15 string binary error binary IRIS Inventor file >15 string ascii ps %F/textfmt -fCourier-Bold -p11bp -U -q >%o <%i This rule is typically the last entry in the file and is used to convert all unmatched ASCII data files to POSTSCRIPT: #offset datatype match result command 0 ascii x ps %F/textfmt -fCourier-Bold -p11bp -U -q >%o <%i NOTES
It is much better to convert data that is to be transmitted to POSTSCRIPT because this data format permits the facsimile server to do the final imaging according to the optimal transfer parameters (resolution, binary encoding, etc.). It might be better to allow secondary rules to augment a primary rule rather than just replace them. This would allow, for example, com- mand line options to be selected based on file type. SEE ALSO
sendfax(1), hylafax-client(1) May 12, 1993 TYPERULES(5)
All times are GMT -4. The time now is 05:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy