Sponsored Content
Top Forums Shell Programming and Scripting replacing spaces with null or 0 in the input file Post 302273801 by cfajohnson on Tuesday 6th of January 2009 12:42:02 AM
Old 01-06-2009
Code:
sed -e 's/||/|null|/g' -e 's/||/|null|/g' FILE

 

10 More Discussions You Might Find Interesting

1. Solaris

finding & replacing blank rows/spaces in a file

Can anyone help me find and replace blank rows in a file with a numeric value (ie blankrow=someTxtOrNumValue), the file is over 500,000 rows long so it would need to be the quickest way as I'll need to do this for multiple files...I would be greatfull for any suggestions....thanks sample file:... (2 Replies)
Discussion started by: Gerry405
2 Replies

2. Shell Programming and Scripting

Handling null input...

Ok, so when a user inputs nothing, simply pressing enter when prompted for a phone number, I get a "./addrbkfct.sh: test: argument expected" error message. I have the following function: addNumber(){ echo "Phone number: \c"; read number; echo $number; if ;... (2 Replies)
Discussion started by: DrRo183
2 Replies

3. Shell Programming and Scripting

need help in replacing spaces in a file

hi all this is the part i am facing a problem eg data: filename : tr1 + T 40 this is a sample record in that file ... the value of T can be anything, but will be a single character. i need to cut from field two, and i am using this command cut -d " " -f2 tr1 >tr3 and the o/p is ... (7 Replies)
Discussion started by: sais
7 Replies

4. Shell Programming and Scripting

Replacing data of output file with input

Hi, I have a ksh which peocess and get me data from 3 days... ie if i process it on jan 28.. it gets data for 25, 26 and 27.... the process run every day and get previous 3 days data...all this data is appened to a file lets call time.out Now time.out cannot have deplicate data so what i want... (10 Replies)
Discussion started by: bhagya2340
10 Replies

5. Shell Programming and Scripting

awk{FIELDWIDTHS} replacing blanks with null

Hi, I am having a file and grabbed the contents of the field according to field widths. The command i used is: awk 'BEGIN{FIELDWIDTHS="10 25 20 14 6 10"}{print$4,$5,$6}' newtext.text >test1.txt i got the output for example: val1 val2 val3 <blank> ... (3 Replies)
Discussion started by: rish_max
3 Replies

6. UNIX for Dummies Questions & Answers

Replacing part of a text file with user input.

Ok, I am brand new to UNIX and I am trying to learn a cross between basic script and database use. I had got some ideas off the net on simple ideas for learning UNIX. I am working on creating a simple phone book program that allows myself to enter our employees from work into a phone book text... (0 Replies)
Discussion started by: georgefurbee
0 Replies

7. Shell Programming and Scripting

Awk replacing file with user input

this section of the awk code i have here takes file to work with from the user. the user specifies the file name from the command line and the file name is assigned to the variable $FLIST awk 'BEGIN { while((getline < "'${FLIST}'")>0) S FS="\n"; RS="}\n" } now, i dont want... (5 Replies)
Discussion started by: SkySmart
5 Replies

8. Shell Programming and Scripting

Select command with variable options having spaces or null contents

Hi, I'm having an issue trying to produce a hierarchical directory menu that has either any directories listed in a specific directory as options or options with spaces in the option content or null content. So the menu function gets passed a base directory, it then lists any .sh scripts in... (6 Replies)
Discussion started by: andyatit
6 Replies

9. Shell Programming and Scripting

Replacing multiple spaces in flat file

Greetings all I have a delimited text file (the delimiter is ';') where certain fields consist of many blanks e.g. ; ; and ; ; Before I separate the data I need to eliminate these blanks altogether. I tried the sed command using the following syntax: sed -i 's/; *;/;;/g' <filename> ... (15 Replies)
Discussion started by: S. BASU
15 Replies

10. Shell Programming and Scripting

Linux Commands needed for replacing variable number of spaces with a single , in a txt file

Hi I want to read a text file and replace various number of spaces between each string in to a single "," or any other character .Please let me know the command to do so. My input file is a txt file which is the output of a SQL table extract so it contains so many spaces between each column of the... (2 Replies)
Discussion started by: Hari Prasanth
2 Replies
g2p-sk(1)							   USER COMMANDS							 g2p-sk(1)

NAME
g2p-sk - phonetic transcription for Slovak SYNOPSIS
g2p-sk [--color] [--dl debug level] [--help] [--stats] [--ofile <file_name>] [<input file>] DESCRIPTION
The phonetic transcription is essential for some linguistic or speech recognition applications. Depending on the language either rule based or statistical approach is being used. g2p-sk implements the rule based approach but in the future it may be replaced by statistical one. Each input word consisting of the sequence of graphemes is transcribed in to the sequence of phones in the SAMPA coding. If no input file is specified, the standard input is expected. If input file is used then the output is written in to the file as well. The filename is input filename with the extension "_trans.txt". The input output code page is ISO 8859-2. To use it with different CP use some CP converter and pipes. For example to have input and output in UTF-8 use (for interactive use): filterm UTF8-iso2 iso2-UTF8 g2p-sk or (for batch processing) iconv -f UTF-8 -t ISO_8859-2 | g2p-sk | iconv -f ISO_8859-2 -t UTF-8 Performance of the phonetic transcription depend on the morphematic segmentation. To improve the quality of the morphematic segmentation is possible to replace the small version of the simple morphematic dictionary in the /usr/share/g2p_sk/Exceptions/morfemy.ddat with the better one. The syllabic segmentation is as important as morphematic one. The syllabic segmentation is provided by sylseg-sk package. The design of the g2p-sk is language dependent. To use it for another language the all rules need to be rewritten. OPTIONS
--color Enable color output. --dl 1..5 Set the debug level. Control the amount of displayed information The debug level 0 displays nothing. The maximum level 5 displays full debugging report. The default debug level is 1. --help Display a short help text --ofile <file_name> Write output also in to given file. --stats Count and display statistic for each phone EXAMPLES
Use standard input and debug level 3: g2p-sk --dl 3 Process all the from file aaa.txt: g2p-sk aaa.txt EXIT STATUS
g2p-sk returns a zero if it succeeds to process all the input words AUTHOR
Jozef Ivanecky (dodo (at) kanoistika.sk) SEE ALSO
sylseg-sk(1), filterm(1), iconv(1), konwert(1) version 0.4 May 17, 2009 g2p-sk(1)
All times are GMT -4. The time now is 06:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy