Sponsored Content
Top Forums Shell Programming and Scripting replacing spaces with null or 0 in the input file Post 302273795 by trichyselva on Tuesday 6th of January 2009 12:20:52 AM
Old 01-06-2009
replacing spaces with null or 0 in the input file

hi
i have records in my input file like this

aaa|1234||2bc||rahul|tamilnadu
bba|2234||b4c||bajaj|tamilnadu


what i am expecting is in between two pipes if there is no character it should be replaced with null or 0

so my file will look like this

aaa|1234|null|2bc|0|rahul|tamilnadu
bba|2234|null|b4c|0|bajaj|tamilnadu


how to do it

can anyone explain

thanks in advance
 

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
IOASIC(4)						   BSD Kernel Interfaces Manual 						 IOASIC(4)

NAME
ioasic -- baseboard IO control ASIC for DEC TURBOchannel systems SYNOPSIS
ioasic0 at tc? slot ? offset ? DESCRIPTION
The ioasic driver provides support for the DEC proprietary IOCTL ASIC found on all DEC TURBOchannel machines with MIPS (DECstation 5000 series, excluding the 5000/200) and Alpha (3000-series) processors. On these machines (including the 5000/200), all baseboard devices should be configured as children of the ioasic device. The ioasic provides hardware DMA channels and interrupt support for several baseboard devices, including one asc SCSI device with a scat- ter/gather DMA channel, an mc146818-compatible mcclock, an Am7930 audio device bba, one or two scc two-port serial devices, and a AMD 7990 LANCE le Ethernet interface. The ioasic is also used for the floppy-disc drive and audio/ISDN hardware on the Personal DECstation and audio-equipped TURBOchannel Alphas, where the ioasic hardware provides a scatter-gather DMA channel between the 16-bit device and the 32-bit tc DMA address space. Support for scatter-gather DMA eliminates the need for additional copying. A baseboard asc SCSI adaptor attached to an ioasic will give slightly better performance than its tc counterpart. SEE ALSO
asc(4), bba(4), intro(4), le(4), mcclock(4), scc(4), tc(4) HISTORY
The ioasic driver first appeared in NetBSD 1.1, derived from DECstation boot-time configuration code in 4.4BSD. BUGS
The DECstation 5000/200 does not actually have an IOASIC chip, but for consistency it must be configured as if it did. BSD
September 12, 1996 BSD
All times are GMT -4. The time now is 10:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy