Sponsored Content
Top Forums UNIX for Dummies Questions & Answers What the command to find out the record length of a fixed length file? Post 302264678 by naughty21 on Thursday 4th of December 2008 02:03:27 PM
Old 12-04-2008
Quote:
Originally Posted by joeyg
Code:
> echo `echo "<EmailAddress>abc@gmail.com</EmailAddress>" | tr ">" "\n" | tr "<" "\n" | grep "@" | wc -c`
14

Note that I am off by one character as the echo gives a new-line.
Thus...

Code:
> echo `echo "<EmailAddress>abc@gmail.com</EmailAddress>" | tr ">" "\n" | tr "<" "\n" | grep "@" | wc -c` -1 | bc
13

or

Code:
> echo "<EmailAddress>abc@gmail.com</EmailAddress>" | tr ">" "\n" | tr "<" "\n" | grep "@" | tr -d "\n" | wc -c
13

thanks for your reply

but if we dont know what is there in between tags then how can we do means if we dont know/we didnt see the email id which is in between tags

for ex: EmailAddress>-------</EmailAddress>" in this ---- is nothing but some email id
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

creating a fixed length output from a variable length input

Is there a command that sets a variable length? I have a input of a variable length field but my output for that field needs to be set to 32 char. Is there such a command? I am on a sun box running ksh Thanks (2 Replies)
Discussion started by: r1500
2 Replies

2. Shell Programming and Scripting

fixed record length

hello! I have a file with fixed record length... format: 123445asdfg 4343777 sfgg I wanna convert it to 123445,asdfg ,4343,777 ,sfgg is there any way to do it? sed/grep/awk?? at the moment I use sed -e 's_ \(\)_,\1_g' but it works only if there are spaces between... (16 Replies)
Discussion started by: george_
16 Replies

3. UNIX for Dummies Questions & Answers

Convert a tab delimited/variable length file to fixed length file

Hi, all. I need to convert a file tab delimited/variable length file in AIX to a fixed lenght file delimited by spaces. This is the input file: 10200002<tab>US$ COM<tab>16/12/2008<tab>2,3775<tab>2,3783 19300978<tab>EURO<tab>16/12/2008<tab>3,28523<tab>3,28657 And this is the expected... (2 Replies)
Discussion started by: Everton_Silveir
2 Replies

4. Shell Programming and Scripting

search and replace fixed length record file

Hi I need to be search a file of fixed length records and when I hit a particular record that match a search string, substitute a known position field In the example file below FHEAD000000000120090806143011 THEAD0000000002Y0000000012 P00000000000000001234 TTAIL0000000003... (0 Replies)
Discussion started by: nedkelly007
0 Replies

5. Shell Programming and Scripting

awk to find the length of each record.

Hi Guys, I wanted to print the length of each record and the record itself. I tried the following awk ... awk 'a=length(); {print $a,$0}' file1 But it is giving me the records instead of length. and also, it giving me each record twice. Means the value of a is not the length of the... (0 Replies)
Discussion started by: mac4rfree
0 Replies

6. Shell Programming and Scripting

Make variable length record a fixed length

Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types: (H)eader Records (D)etail Records (T)railer Records The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Discussion started by: jclanc8
3 Replies

7. Shell Programming and Scripting

Using cut command in a fixed length file

Hi, I have a file which have set of rows and has to create separate files based on the id. Eg: 001_AHaris020 001_ATony030 002_AChris090 002_ASmit060 003_AJhon001 Output: I want three files like 001_A.txt, 002_A.txt and 003_A.txt. 001_A.txt should have ... (4 Replies)
Discussion started by: techmoris
4 Replies

8. Shell Programming and Scripting

changing a variable length text to a fixed length

Hi, Can anyone help with a effective solution ? I need to change a variable length text field (between 1 - 18 characters) to a fixed length text of 18 characters with the unused portion, at the end, filled with spaces. The text field is actually field 10 of a .csv file however I could cut... (7 Replies)
Discussion started by: dc18
7 Replies

9. Shell Programming and Scripting

Add substring in a file containing fixed length record.

I am new to awk and writing a script using awk. I have file containing fixed length records, I wish to extract 2 substring(each substring is padded with zeros on left e.g 000000003623) and add each substring respectively for every record in the file to get total sum of respective substring for all... (5 Replies)
Discussion started by: Devesh5683
5 Replies

10. Shell Programming and Scripting

Convert variable length record to fixed length

Hi Team, I have an issue to split the file which is having special chracter(German Char) using awk command. I have a different length records in a file. I am separating the files based on the length using awk command. The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 Replies
LIQUIDSOAP(1)						      General Commands Manual						     LIQUIDSOAP(1)

NAME
liquidsoap - a multimedia streaming language SYNOPSIS
liquidsoap [options] [script|expression] DESCRIPTION
Liquidsoap is a programming language for describing multimedia streaming systems. It is very flexible, making simple things simple but giving a lot of control for advanced uses. Liquidsoap supports audio, video and MIDI streams, and a wide range of input/output operators including Icecast and various soundcard APIs. It can perform a broad range of signal processing, combine streams in various ways, support custom transitions, generate sound procedurally... and all this can be assembled as you wish. Input files can be accessed remotely, or even be synthesized on the fly using external scripts such as speech synthesis. Finally, interaction with a running liquidsoap instance is possible via telnet or socket. Liquidsoap scripts passed on the command line will be evaluated: they shall be used to define the streaming system to be ran. It is possi- ble to pass multiple scripts; they will all be ran successively, and definitions from one script can be used in subsequent ones. A script will be read from standard input if - is given as script filename. Information about scripting liquidsoap is available on our website: http://savonet.sf.net/ If the parameter is not a file it will be treated as an expression which will be executed. It is a convenient way to test simple one-line scripts. When running only one-liners, the default is to log messages directly on stdout rather than to a file. OPTIONS
- Read script from standard input. -- Stop parsing the command-line and pass subsequent items to the script. --debug Print debugging log messages. --dynamic-plugins-dir path Directory where to look for plugins. --errors-as-warnings Issue warnings instead of fatal errors for unused variables and ignored expressions. If you are not sure about it, it is better to not use it. --interactive Start an interactive interpreter. --list-plugins List all plugins (builtin scripting values, supported formats and protocols). --list-plugins-xml List all plugins (builtin scripting values, supported formats and protocols), output as XML. --no-pervasives Do not load pervasive script libraries. --version Display liquidsoap's version. -c, --check Check and evaluate scripts but do not perform any streaming. -cl, --check-lib Like --check but treats all scripts and expressions as libraries, so that unused toplevel variables are not reported. -d, --daemon Run in daemon mode. -f, --force-start For advanced dynamic uses: force liquidsoap to start even when no active source is initially defined. -h plugin Print the description of a plugin, eg. a builtin scripting function. -i Display infered types. -p, --parse-only Parse scripts but do not type-check and run them. -q, --quiet Do not print log messages on standard output. -r filename Process a request. -T, --disable-telnet Disable the telnet server. -U, --disable-unix-socket Disable the unix socket. -t, --enable-telnet Enable the telnet server. -u, --enable-unix-socket Enable the unix socket. -v, --verbose Print log messages on standard output. --conf-descr-key key Describe a configuration key. --conf-descr Show all configuration keys with their documentation. --conf-descr-liqi Show all configuration keys with their documentation in liqi (documentation wiki) format. --conf-dump Dump the configuration state -help, --help Display this list of options SEE ALSO
Our website http://savonet.sf.net/ and the HTML documentation coming with your distribution of liquidsoap. AUTHOR
Savonet team <savonet-users@lists.sourceforge.net> Liquidsoap 1.0.1 June 25, 2012 LIQUIDSOAP(1)
All times are GMT -4. The time now is 11:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy