Sponsored Content
Full Discussion: Replacing '-' by 0 in a file
Top Forums Shell Programming and Scripting Replacing '-' by 0 in a file Post 302369999 by learning_skills on Tuesday 10th of November 2009 06:05:51 AM
Old 11-10-2009
Error Replacing '-' by 0 in a file

Hi,

I have the following data in my file (file.csv):

My.com,21 September 2009,ace,42,0,0,0,-,-
My.com,21 September 2009,adb,3,0,0,0,-,-
My.com,21 September 2009,agp,3,0,0,0,-,-
My.com,21 September 2009,alc,23,0,0,0,-,-

I need to prepare a UNIX script, where the '-' can be relaced by zero (0) throughout the file length.

Please advice.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Create a file after replacing a particular pattern in another file

I have a file as below: file1 ----- 1|CT1909090TRYGH 2|CTH909090GHDGJ 4|CT9909090HSGUS 10|AT0735732YQGDJ 21|CTP909090BAFSL 100|BAI891253NSHDD Now, I have to replace "909090" to "451234". Since after the pipe delimiter, the field positions are fixed, so i tried the below command: awk... (5 Replies)
Discussion started by: PriyankaM
5 Replies

2. Shell Programming and Scripting

sed command for copying the contents of other file replacing it another file on specifc pattern

We have 2 file XML files - FILE1.XML and FILE2.xml - we need copy the contents of FILE1.XML and replace in FILE2.xml pattern "<assignedAttributeList></assignedAttributeList>" FILE1.XML 1. <itemList> 2. <item type="Manufactured"> 3. <resourceCode>431048</resourceCode> 4. ... (0 Replies)
Discussion started by: balrajg
0 Replies

3. Shell Programming and Scripting

Replacing the name in a file

Hi, I need to remove the word from a SQL file and need to replace with another word. I tried with Need to replace example.com/1/ to domain.com I tried with :%s/example.com/1/domain.com But that does not worked out. (2 Replies)
Discussion started by: gsiva
2 Replies

4. Shell Programming and Scripting

Replacing multiple lines in file from another file

Hi All, I'm trying to parse a XML file and replace few lines of file with text present in another file. But only issue is I need to replace only those lines from XML which are preceeding the JOBNAME =*RRN* For ex test.xml(content of XML file in which I want to replace lines is ) <JOB . . .... (10 Replies)
Discussion started by: techneel
10 Replies

5. Red Hat

Help with replacing a file

Hi I need to replace A file with B when file A has no contents in linux. Thanks (5 Replies)
Discussion started by: mostwantedkisss
5 Replies

6. Shell Programming and Scripting

Replacing column 1 in one file with values in other file

Please help me with an shell / awk script to achieve following; File-1: ABCDW01 12322 23322 BDADW01 22232 24453 EDFAW00 32232 23422 and so on, notice that the first coloumn is a code and the another file contains the real value of each entry in the first colum above but not in a... (4 Replies)
Discussion started by: digipak
4 Replies

7. Shell Programming and Scripting

sed -Replacing file path within .txt file

Hi, I am trying to use sed to replace a file path within all the .lay (.txt) files in a folder. I feel that this should be easy but I can't get it to work no matter what i try. I'm using cygwin. For a .txt file containing the below line I want to replace this file path with a new one. ... (1 Reply)
Discussion started by: carlr
1 Replies

8. Shell Programming and Scripting

replacing \ with / in a file

I have a file as below: 1578449 |\\DEV-HUB1\WB_Enterprise_MAM\\4-5-2011\dsuggTO\E0003908_2692725_30.jpg 1578450 |\\DEV-HUB1\WB_Enterprise_MAM\\4-5-2011\dsuggTO\E0003908_2692725_31.jpg 1578451 |\\DEV-HUB1\WB_Enterprise_MAM\\4-5-2011\dsuggTO\E0003908_2692725_32.jpg 1578452... (5 Replies)
Discussion started by: Vidhyaprakash
5 Replies

9. Shell Programming and Scripting

Replacing 12 columns of one file by second file based on mapping in third file

i have a real data prod file with 80+ fields containing 1k -2k records. i have to extract say 12 columns out of this which are sensitive fields along with one primary key say SEQ_ID (like DOB,account no, name, SEQ_ID, govtid etc) in a lookup file. i have to replace these sensitive fields in... (11 Replies)
Discussion started by: megh12
11 Replies

10. Shell Programming and Scripting

Replacing match lines from one file with another file

Please help me in this scenario i have two text files as below file1.txt record_1 conversion of a file; code change; data types; lenght; end; record_2 field name; string; new fileline; end; record_3 (7 Replies)
Discussion started by: velraj9
7 Replies
DMTXWRITE(1)						      General Commands Manual						      DMTXWRITE(1)

NAME
dmtxwrite - create Data Matrix barcodes SYNOPSIS
dmtxwrite [OPTION]... [FILE] DESCRIPTION
dmtxwrite encodes data from a file or standard input, and writes the resulting ECC200 Data Matrix barcode as an image. OPTIONS
-c, --codewords Print codeword listing instead of creating barcode. -d, --module=N Module size in pixels. -m, --margin=N Margin size in pixels. -e, --encoding=[bfactxe8] Encodation scheme. b = Best optimized best possible optimization (beta) f = Fast optimized basic optimization (not implemented) a = ASCII [default] ASCII standard & extended c = C40 digits and uppercase t = Text digits and lowercase x = X12 ANSI X12 EDI e = EDIFACT ASCII values 32-94 8 = Base 256 all byte values 0-255 -f, --format=FORMAT Output image format (PNG [default], TIF, GIF, PDF, etc...). -l, --list-formats List available image formats. -o, --output=FILE Barcode output filename. Default is standard output. -p, --preview Print ASCII art preview to standard output. -r, --resolution=N Set image print resolution (dpi). -s, --symbol-size=[sr|RxC] (default "s") Automatic symbol size options: s = Auto square r = Auto rectangle Manual symbol size options for square symbols: 10x10 12x12 14x14 16x16 18x18 20x20 22x22 24x24 26x26 32x32 36x36 40x40 44x44 48x48 52x52 64x64 72x72 80x80 88x88 96x96 104x104 120x120 132x132 144x144 Manually symbol size options for rectangle symbols: 8x18 8x32 12x26 12x36 16x36 16x48 -C, --color=COLOR Barcode color (not implemented). -B, --bg-color=COLOR Background color (not implemented). -M, --mosaic Create non-standard Data Mosaic barcode. -R, --rotate=DEGREES Rotation angle in degrees (not implemented). -v, --verbose Use verbose messages. -V, --version Print program version information. --help Display this help message and quit. STANDARDS
ISO/IEC 16022:2000 ANSI/AIM BC11 ISS BUGS
Email bug reports to mike@dragonflylogic.com AUTHOR
Copyright (C) 2008, 2009 Mike Laughton September 4, 2009 DMTXWRITE(1)
All times are GMT -4. The time now is 12:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy